Ephedra regional gradient (ERG) analyses

ecoblender

alex.filazzola

Abstract

An under-examined component of the shrub-annual relationship is how regional drivers, such as climate, may alter the sign or magnitude of positive interactions. Interspecific interactions between plants have been shown to be strongly linked to climate, particularly temperature and precipitation. The stress-gradient hypothesis (SGH) predicts that higher abiotic stress (i.e. for deserts, increasing temperature and reduced precipitation) will increase the frequency of positive interactions among shrubs and their annual understory. Regional climate gradients also have indirect effects on plant composition, such as determining consumer abundance and soil nutrient composition. Nutrient availability is particularly affected by precipitation because of altered decomposition rates of organic matter and mineralization. Therefore, the strength of facilitation and operating mechanism of a shrub on the annual plant community may change along a regional gradient.

Hypothesis

We tested the hypothesis that positive interactions among shrubs and annual plants will increase with abiotic stress and reduce nutrient availability along a regional gradient of aridity.

Methods

Weather for growing season

Climate patterns within study

season1.sjd <- season1 %>% filter(Gradient<4) %>% group_by(year, month,days) %>% summarise_if(is.numeric, funs(mean(., na.rm=T)))
season1.mnp <- season1 %>% filter(Gradient>3)%>% group_by(year, month,days) %>% summarise_if(is.numeric, funs(mean(., na.rm=T)))
season2.sjd <- season2 %>% filter(Gradient<4) %>% group_by(year, month,days) %>% summarise_if(is.numeric, funs(mean(., na.rm=T)))
season2.mnp <- season2 %>% filter(Gradient>3)%>% group_by(year, month,days) %>% summarise_if(is.numeric, funs(mean(., na.rm=T)))

## Rain vs Temperature in 2016
par(mfrow=c(2,1))
par(mar=c(1.5,4.5,1,4.5))
plot1 <- barplot(height=season1.sjd$Precip, ylim=c(0,14), ylab="Average precipitation at all sites (cm)")
points(plot1[,1], season1.sjd$min.temp, type="l", col="#FF000050", lwd=2)
axis(4, at=seq(0,14,2), lab=seq(0,14,2), ylab="")
mtext("Average temperature at all sites (°C)", 4, line=3)
par(mar=c(4.5,4.5,0,4.5))
plot1 <- barplot(height=season1.mnp$Precip, ylim=c(0,14), ylab="Average precipitation at all sites (cm)")
axis(1, plot1[c(1,30,60,90,120,150,180)], c("Nov","Dec","Jan","Feb","Mar","Apr","May"))
points(plot1[,1], season1.mnp$min.temp, type="l", col="#FF000050", lwd=2)
axis(4, at=seq(0,14,2), lab=seq(0,14,2), ylab="")
mtext("Average temperature at all sites (°C)", 4, line=3)

## Rain vs Temperature in 2017
par(mfrow=c(2,1))
par(mar=c(1.5,4.5,1,4.5))
plot2 <- barplot(height=season2.sjd$Precip, ylim=c(0,14), ylab="Average precipitation at all sites (cm)")
points(plot2[,1], season2.sjd$min.temp, type="l", col="#FF000050", lwd=2)
axis(4, at=seq(0,14,2), lab=seq(0,14,2), ylab="")
mtext("Average temperature at all sites (°C)", 4, line=3)
par(mar=c(4.5,4.5,0,4.5))
plot2 <- barplot(height=season2.mnp$Precip, ylim=c(0,14), ylab="Average precipitation at all sites (cm)")
points(plot2[,1], season2.mnp$min.temp, type="l", col="#FF000050", lwd=2)
axis(1, plot1[c(1,30,60,90,120,150,180)], c("Nov","Dec","Jan","Feb","Mar","Apr","May"))
axis(4, at=seq(0,14,2), lab=seq(0,14,2), ylab="")
mtext("Average temperature at all sites (°C)", 4, line=3)

### 2016 The rain was inconsistent and mostly absent in the Mojave. This resulted in low germination and producitivty at the southern sites
### 2017 The rain was more plentiful, but in the northern sites, there appears to be a frost period after the majority of the rainfall. Need to check number of frost days

season1.frost <- season1 %>% group_by(Site) %>% summarize(frost.days=sum(min.temp<0, na.rm=T)/length(min.temp)*100)
data.frame(season1.frost)
##              Site frost.days
## 1         Barstow  24.725275
## 2          Cuyama  29.670330
## 3   HeartofMojave  25.824176
## 4    PanocheHills  10.439560
## 5 SheepholeValley   6.043956
## 6          Tecopa  23.626374
## 7      TejonRanch  50.549451
season2.frost <- season2 %>% group_by(Site) %>% summarize(frost.days=sum(min.temp<0, na.rm=T)/length(min.temp)*100)
data.frame(season2.frost)
##              Site frost.days
## 1         Barstow  17.679558
## 2          Cuyama  19.889503
## 3   HeartofMojave  16.574586
## 4    PanocheHills  14.917127
## 5 SheepholeValley   1.785714
## 6          Tecopa  25.966851
## 7      TejonRanch  35.911602
## Both years had comparable number of frost days

## Compare number of consecutive frost days (i.e. frost periods)
season1[,"frost"] <- ifelse(season1$min.temp<0, -99,season1$min.temp) ## identified days below freezing
season2[,"frost"] <- ifelse(season2$min.temp<0, -99,season2$min.temp) ## identified days below freezing
count.consec <- function(x) {max(rle(as.character(x))$lengths)}

season1.frost <- season1 %>% group_by(Site)  %>% summarize(count.consec(frost))
data.frame(season1.frost)
##              Site count.consec.frost.
## 1         Barstow                  10
## 2          Cuyama                  10
## 3   HeartofMojave                  12
## 4    PanocheHills                   5
## 5 SheepholeValley                   7
## 6          Tecopa                  11
## 7      TejonRanch                  14
season2.frost <- season2 %>% group_by(Site) %>% summarize(count.consec(frost))
data.frame(season2.frost)
##              Site count.consec.frost.
## 1         Barstow                   5
## 2          Cuyama                   6
## 3   HeartofMojave                   7
## 4    PanocheHills                   6
## 5 SheepholeValley                   3
## 6          Tecopa                   7
## 7      TejonRanch                  13
## compare only after plants have germinated
season1.frost <- season1 %>% group_by(Site) %>% filter(year>2015) %>% summarize(frost.days=sum(min.temp<0, na.rm=T)/length(min.temp)*100, avg.min.temp=mean(min.temp, na.rm=T))
data.frame(season1.frost)
##              Site frost.days avg.min.temp
## 1         Barstow  12.396694     5.750413
## 2          Cuyama  11.570248     3.352893
## 3   HeartofMojave  16.528926     4.542149
## 4    PanocheHills   2.479339     6.777686
## 5 SheepholeValley   2.479339     9.394167
## 6          Tecopa  11.570248     6.342149
## 7      TejonRanch  33.884298     1.438017
season2.frost <- season2 %>% group_by(Site) %>%  filter(year>2016) %>%  summarize(frost.days=sum(min.temp<0, na.rm=T)/length(min.temp)*100,avg.min.temp=mean(min.temp, na.rm=T))
data.frame(season2.frost)
##              Site frost.days avg.min.temp
## 1         Barstow  11.666667     6.052500
## 2          Cuyama  16.666667     3.624167
## 3   HeartofMojave   8.333333     5.637838
## 4    PanocheHills   8.333333     6.065833
## 5 SheepholeValley   0.000000     9.386916
## 6          Tecopa  20.833333     5.938333
## 7      TejonRanch  28.333333     2.535833
season1.frost <- season1 %>% group_by(Site)  %>% filter(year>2015) %>% summarize(count.consec(frost))
data.frame(season1.frost)
##              Site count.consec.frost.
## 1         Barstow                   5
## 2          Cuyama                   6
## 3   HeartofMojave                   4
## 4    PanocheHills                   2
## 5 SheepholeValley                   2
## 6          Tecopa                   4
## 7      TejonRanch                  10
season2.frost <- season2 %>% group_by(Site)  %>%  filter(year>2016)%>% summarize(count.consec(frost))
data.frame(season2.frost)
##              Site count.consec.frost.
## 1         Barstow                   5
## 2          Cuyama                   6
## 3   HeartofMojave                   3
## 4    PanocheHills                   3
## 5 SheepholeValley                   2
## 6          Tecopa                   5
## 7      TejonRanch                  10

Microenvironmental differences

We compared temperature and relative humidity between shrub and open microsites among all sites along the regional gradient


    Shapiro-Wilk normality test

data:  fit1$residuals
W = 0.99375, p-value = 0.07069
                Df Sum Sq Mean Sq F value   Pr(>F)    
micro            1  1.804  1.8040  159.02  < 2e-16 ***
gradient         6 17.302  2.8837  254.20  < 2e-16 ***
micro:gradient   6  0.775  0.1292   11.39 8.29e-12 ***
Residuals      420  4.765  0.0113                     
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Analysis of Deviance Table

Model: binomial, link: logit

Response: RH/100

Terms added sequentially (first to last)

               Df Deviance Resid. Df Resid. Dev  Pr(>Chi)    
NULL                             433     60.430              
micro           1    0.005       432     60.426    0.9465    
gradient        6   53.103       426      7.323 1.119e-09 ***
micro:gradient  6    1.848       420      5.475    0.9331    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Analysis of Deviance Table

Model: Gamma, link: inverse

Response: swc

Terms added sequentially (first to last)

               Df Deviance Resid. Df Resid. Dev        F Pr(>F)    
NULL                             404    231.405                    
Site            6  189.683       398     41.722 381.2179 <2e-16 ***
Microsite       1    0.287       397     41.435   3.4579 0.0637 .  
Site:Microsite  6    0.696       391     40.739   1.3994 0.2136    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Analysis of Deviance Table

Model: Gamma, link: inverse

Response: swc

Terms added sequentially (first to last)

               Df Deviance Resid. Df Resid. Dev        F Pr(>F)    
NULL                             419    183.193                    
Site            6  144.930       413     38.263 279.4537 <2e-16 ***
Microsite       1    0.080       412     38.183   0.9284 0.3358    
Site:Microsite  6    0.535       406     37.647   1.0322 0.4037    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

site level means

## site coordintes
site.gps <- read.csv("Data/ERGsites.csv")
# nutrient data for each site
nutrients <- read.csv("Data/ERG.soilnutrients.csv")
 ## long term climate data extracted from worldclim
clim.dat <- read.csv("Data/ERG.worldclim.csv")


## check correlation among long-term climate variables
cor(clim.dat[,3:8]) ## Temp.wettest.QR least correlated 
##                    Annual.Temp Temp.Seasonality Temp.wettest.QR
## Annual.Temp          1.0000000        0.9051791       0.7260617
## Temp.Seasonality     0.9051791        1.0000000       0.4650548
## Temp.wettest.QR      0.7260617        0.4650548       1.0000000
## Annual.precip       -0.8911069       -0.9650533      -0.5313460
## Precip.seasonality  -0.9715419       -0.9774646      -0.6165170
## Precipt.wettest.QR  -0.8839124       -0.9570957      -0.5523347
##                    Annual.precip Precip.seasonality Precipt.wettest.QR
## Annual.Temp           -0.8911069         -0.9715419         -0.8839124
## Temp.Seasonality      -0.9650533         -0.9774646         -0.9570957
## Temp.wettest.QR       -0.5313460         -0.6165170         -0.5523347
## Annual.precip          1.0000000          0.9613729          0.9980959
## Precip.seasonality     0.9613729          1.0000000          0.9543657
## Precipt.wettest.QR     0.9980959          0.9543657          1.0000000
## Obtain mean shrub traits for each site
shrubs <- read.csv("Data/ERG.shrub.csv")
shrubs <- subset(shrubs, Microsite=="shrub")
shrubs.mean <- shrubs %>% group_by(Gradient,Site) %>% summarise_all(funs(mean))
shrubs.mean <- data.frame(shrubs.mean)
shrubs.vars <- shrubs.mean[,c("Site","Gradient","volume","canopy","Dx","DxEph","Compaction")] 

## test correlation among shrub traits
cor(shrubs.vars[,3:7]) ## compaction x volume & DxEph x Dx high correlation
##                volume     canopy          Dx      DxEph  Compaction
## volume      1.0000000  0.2243902  0.40036651  0.2631563 -0.64927168
## canopy      0.2243902  1.0000000 -0.68479570 -0.3538094 -0.20833287
## Dx          0.4003665 -0.6847957  1.00000000  0.7803527 -0.06531485
## DxEph       0.2631563 -0.3538094  0.78035272  1.0000000  0.33769574
## Compaction -0.6492717 -0.2083329 -0.06531485  0.3376957  1.00000000
vifstep(shrubs.vars[,3:7], th=10) ## Dx showing collinearity problems
## 1 variables from the 5 input variables have collinearity problem: 
##  
## Dx 
## 
## After excluding the collinear variables, the linear correlation coefficients ranges between: 
## min correlation ( Compaction ~ canopy ):  -0.2083329 
## max correlation ( Compaction ~ volume ):  -0.6492717 
## 
## ---------- VIFs of the remained variables -------- 
##    Variables      VIF
## 1     volume 4.043473
## 2     canopy 1.474526
## 3      DxEph 2.874621
## 4 Compaction 3.760284
shrub.site <- shrubs.vars[,-c(1,2,5)]
rownames(shrub.site) <- shrubs.vars[,1]

## PCA of shrub characteristics
pca1 <- prcomp(log(shrub.site), scale=T)
plot(pca1)

biplot(pca1, scale = T)

summary(pca1) ## 77% variation explained
## Importance of components:
##                           PC1    PC2    PC3     PC4
## Standard deviation     1.2958 1.1879 0.8922 0.33722
## Proportion of Variance 0.4198 0.3528 0.1990 0.02843
## Cumulative Proportion  0.4198 0.7725 0.9716 1.00000
## PCA of site characteristics for season1
## Obtain mean weather variables for each site
season1.mean <- season1 %>% group_by(Gradient,Site) %>% summarise(temp.var=var(avg.temp,na.rm=T),Precip=sum(Precip),wind=mean(wind.speed, na.rm=T))
season1.mean  <- data.frame(season1.mean)
## extract key variables
## dropped RH, and chose min.temp because least correlation with others & cold stress

##combine nutrients and long-term averages
site.vars <- data.frame(season1.mean[,3:5],site.gps["elevation"]) ## drop Phosphorus and other climate variables because of correlations, 
row.names(site.vars) <- shrubs.vars[,1]
cor(site.vars)
##              temp.var     Precip        wind  elevation
## temp.var   1.00000000 -0.8679054  0.05816084 -0.3100598
## Precip    -0.86790537  1.0000000 -0.37279135  0.1197715
## wind       0.05816084 -0.3727914  1.00000000  0.4680108
## elevation -0.31005981  0.1197715  0.46801084  1.0000000
site.vars2016 <- site.vars

##  check for collinearity
vifstep(site.vars, th=10) ## remove potassium and temperature minimum
## No variable from the 4 input variables has collinearity problem. 
## 
## The linear correlation coefficients ranges between: 
## min correlation ( wind ~ temp.var ):  0.05816084 
## max correlation ( Precip ~ temp.var ):  -0.8679054 
## 
## ---------- VIFs of the remained variables -------- 
##   Variables      VIF
## 1  temp.var 6.190318
## 2    Precip 7.022018
## 3      wind 2.120866
## 4 elevation 1.500626
pca1 <- prcomp(log(abs(site.vars)), scale=T)
plot(pca1)

biplot(pca1)

## check contribution of loadings
pca1$rotation
##                  PC1         PC2         PC3        PC4
## temp.var   0.6340914 -0.05810223  0.57710857 -0.5113687
## Precip    -0.6784404 -0.15132401  0.09928838 -0.7120123
## wind       0.1851081  0.75272565 -0.48565259 -0.4040800
## elevation -0.3215303  0.63806683  0.64902163  0.2612660
aload <- abs(pca1$rotation)
sweep(aload, 2, colSums(aload), "/")
##                 PC1        PC2        PC3       PC4
## temp.var  0.3485608 0.03630893 0.31865593 0.2707478
## Precip    0.3729395 0.09456458 0.05482301 0.3769800
## wind      0.1017541 0.47038923 0.26815765 0.2139430
## elevation 0.1767456 0.39873726 0.35836340 0.1383291
summary(pca1) ## 89% variation explained
## Importance of components:
##                           PC1    PC2    PC3     PC4
## Standard deviation     1.4405 1.1996 0.6867 0.12018
## Proportion of Variance 0.5188 0.3597 0.1179 0.00361
## Cumulative Proportion  0.5188 0.8785 0.9964 1.00000
gradient1.season1 <- pca1$x[,1]
gradient2.season1 <- pca1$x[,2]

## season2
season2.mean <- season2 %>% group_by(Gradient,Site) %>% summarise(temp.var=var(avg.temp,na.rm=T),Precip=sum(Precip, na.rm=T),wind=mean(wind.speed, na.rm=T))
season2.mean  <- data.frame(season2.mean)
## extract key variables
## dropped RH, and chose min.temp because least correlation with others & cold stress

##combine nutrients and long-term averages
site.vars <- data.frame(season2.mean[,3:5],site.gps["elevation"]) ## drop Phosphorus and other climate variables because of correlations, 
row.names(site.vars) <-  shrubs.vars[,1]
cor(site.vars)
##             temp.var     Precip       wind  elevation
## temp.var   1.0000000 -0.7427028 -0.2262409 -0.3996999
## Precip    -0.7427028  1.0000000 -0.1551517  0.2554805
## wind      -0.2262409 -0.1551517  1.0000000  0.5792844
## elevation -0.3996999  0.2554805  0.5792844  1.0000000
site.vars2017 <- site.vars


##  check for collinearity
vifstep(site.vars, th=10) ## remove potassium and temperature minimum
## No variable from the 4 input variables has collinearity problem. 
## 
## The linear correlation coefficients ranges between: 
## min correlation ( wind ~ Precip ):  -0.1551517 
## max correlation ( Precip ~ temp.var ):  -0.7427028 
## 
## ---------- VIFs of the remained variables -------- 
##   Variables      VIF
## 1  temp.var 3.041063
## 2    Precip 3.208232
## 3      wind 2.155356
## 4 elevation 1.844735
pca2 <- prcomp(log(abs(site.vars)), scale=T)
plot(pca2)

biplot(pca2)

summary(pca2) ## 85% variation explained
## Importance of components:
##                           PC1    PC2     PC3     PC4
## Standard deviation     1.5002 1.1069 0.62814 0.36016
## Proportion of Variance 0.5626 0.3063 0.09864 0.03243
## Cumulative Proportion  0.5626 0.8689 0.96757 1.00000
## check contribution of loadings
pca2$rotation
##                  PC1        PC2         PC3        PC4
## temp.var   0.5836474 -0.2879037  0.46403105  0.6009512
## Precip    -0.5465748  0.4632885  0.07702085  0.6933164
## wind      -0.3004017 -0.7480738 -0.49872544  0.3184610
## elevation -0.5199717 -0.3779695  0.72802192 -0.2382280
aload <- abs(pca2$rotation)
sweep(aload, 2, colSums(aload), "/")
##                 PC1       PC2        PC3       PC4
## temp.var  0.2992150 0.1533658 0.26249081 0.3246706
## Precip    0.2802092 0.2467930 0.04356877 0.3745719
## wind      0.1540051 0.3984976 0.28211656 0.1720521
## elevation 0.2665708 0.2013437 0.41182386 0.1287053
## define gradients
gradient1.season2 <- pca2$x[,1]
gradient2.season2 <- pca2$x[,2]

Compare gradient to phytometer

mean.phyto <- census %>% filter(Census=="end") %>%group_by(Year, Gradient, Site, Microsite) %>% summarise_if(is.numeric, funs(mean(., na.rm=T)))
mean.phyto <- data.frame(mean.phyto)

season1.mean <- season1 %>% group_by(Gradient,Site) %>% summarise(temp.var=var(avg.temp,na.rm=T),Precip=sum(Precip),wind=mean(wind.speed, na.rm=T), max.temp=abs(mean(max.temp, na.rm=T)))
s1.mean <- data.frame(season1.mean)

season2.mean <- season2 %>% group_by(Gradient,Site) %>% summarise(temp.var=var(avg.temp,na.rm=T),Precip=sum(Precip, na.rm=T),wind=mean(wind.speed, na.rm=T), max.temp=abs(mean(max.temp, na.rm=T)))
s2.mean <- data.frame(season2.mean)

gradient1.season1 <- (s1.mean[,"Precip"]-s1.mean[,"max.temp"])/10
gradient1.season2 <- (s2.mean[,"Precip"]-s2.mean[,"max.temp"])/10

phyto.2016 <- subset(mean.phyto, Year==2016)

plot(gradient1.season1+1, phyto.2016[phyto.2016$Microsite=="open","phyto.biomass"], ylim=c(0,2))
points(gradient1.season1-1, phyto.2016[phyto.2016$Microsite=="shrub","phyto.biomass"], pch=19)

phyto.2017 <- subset(mean.phyto, Year==2017)

plot(gradient1.season2, phyto.2017[phyto.2017$Microsite=="open","phyto.biomass"], ylim=c(0,3))
points(gradient1.season2, phyto.2017[phyto.2017$Microsite=="shrub","phyto.biomass"], pch=19)

Differences from Nutrient content

## Nitrogen difference between shrub and sites
m.nit <- aov(log(N) ~ site * microsite, data=nutrients)
summary(m.nit)
##                Df Sum Sq Mean Sq F value   Pr(>F)    
## site            6  63.04   10.51  13.241 2.86e-09 ***
## microsite       1  40.16   40.16  50.614 2.24e-09 ***
## site:microsite  6   4.96    0.83   1.042    0.408    
## Residuals      56  44.43    0.79                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(m.nit, "microsite")
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = log(N) ~ site * microsite, data = nutrients)
## 
## $microsite
##                diff      lwr      upr p adj
## shrub-open 1.514873 1.088317 1.941429     0
## Potassium difference between shrub and sites
m.pot <- aov(log(K) ~ site * microsite, data=nutrients)
summary(m.pot)
##                Df Sum Sq Mean Sq F value   Pr(>F)    
## site            6 15.234   2.539   20.46 1.62e-12 ***
## microsite       1  4.019   4.019   32.39 4.80e-07 ***
## site:microsite  6  1.571   0.262    2.11   0.0664 .  
## Residuals      56  6.948   0.124                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(m.pot, "microsite")
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = log(K) ~ site * microsite, data = nutrients)
## 
## $microsite
##                 diff      lwr       upr p adj
## shrub-open 0.4792314 0.310559 0.6479038 5e-07
## Phosphorus difference between shrub and sites
m.pho <- aov(log(P) ~ site * microsite, data=nutrients)
summary(m.pho)
##                Df Sum Sq Mean Sq F value   Pr(>F)    
## site            6 23.163   3.861   14.33 8.10e-10 ***
## microsite       1 10.546  10.546   39.15 5.79e-08 ***
## site:microsite  6  3.394   0.566    2.10   0.0676 .  
## Residuals      56 15.085   0.269                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(m.pho, "microsite")
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = log(P) ~ site * microsite, data = nutrients)
## 
## $microsite
##                 diff       lwr      upr p adj
## shrub-open 0.7762734 0.5277317 1.024815 1e-07

annual plant community repsonse

spp.data  <- read.csv("Data/ERG.communitydata.csv")
spp.data[is.na(spp.data)] <- 0

mean.spp <- spp.data %>% group_by(Year,Site) %>%  summarize(abd=mean(Abundance), richness=mean(Richness), biomass=mean(Biomass))
mean.spp <- data.frame(mean.spp)

## sort to gradient from alphabetical
alpha.grad <- c(4,2,5,1,6,7,3)
mean.spp2016 <- subset(mean.spp, Year==2016)
mean.spp2016  <-mean.spp[order(alpha.grad),]

## community responses 
plot(gradient1.season1, mean.spp2016[,"richness"]) ## explains trends with one outlier

m1 <- lm(richness~gradient1.season1, data=mean.spp2016)
summary(m1)
## 
## Call:
## lm(formula = richness ~ gradient1.season1, data = mean.spp2016)
## 
## Residuals:
##       4       2       7       1       3       5       6 
## -0.7006  0.7022  1.3742 -1.7940  1.3879 -1.2670  0.2974 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)  
## (Intercept)        1.81086    0.68451   2.645   0.0457 *
## gradient1.season1  0.04821    0.07411   0.651   0.5441  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.394 on 5 degrees of freedom
## Multiple R-squared:  0.07803,    Adjusted R-squared:  -0.1064 
## F-statistic: 0.4232 on 1 and 5 DF,  p-value: 0.5441
plot(gradient1.season1, mean.spp2016[,"abd"]) ## explains trends with one outlier

m2 <- lm(abd~gradient1.season1, data=mean.spp2016) ## trend
summary(m2)
## 
## Call:
## lm(formula = abd ~ gradient1.season1, data = mean.spp2016)
## 
## Residuals:
##       4       2       7       1       3       5       6 
##  19.671 -37.660   3.599   2.445  11.246  -8.390   9.089 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)   
## (Intercept)        -0.2211    10.0748  -0.022  0.98334   
## gradient1.season1   6.3754     1.0908   5.845  0.00208 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 20.51 on 5 degrees of freedom
## Multiple R-squared:  0.8723, Adjusted R-squared:  0.8468 
## F-statistic: 34.16 on 1 and 5 DF,  p-value: 0.002075
plot(gradient2.season1, mean.spp2016[,"biomass"]) ## explains trends with one outlier

m3 <- lm(biomass~gradient1.season1, data=mean.spp2016) ## trend
summary(m3)
## 
## Call:
## lm(formula = biomass ~ gradient1.season1, data = mean.spp2016)
## 
## Residuals:
##       4       2       7       1       3       5       6 
##  2.3417 -3.2663 -1.4100  0.5527  2.2333 -0.1950 -0.2565 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)   
## (Intercept)        -0.3699     1.0657  -0.347  0.74266   
## gradient1.season1   0.5242     0.1154   4.543  0.00615 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.17 on 5 degrees of freedom
## Multiple R-squared:  0.805,  Adjusted R-squared:  0.766 
## F-statistic: 20.64 on 1 and 5 DF,  p-value: 0.006151
##season2
## sort to gradient from alphabetical
alpha.grad <- c(4,2,5,1,6,7,3)
mean.spp <- subset(mean.spp, Year==2017)
mean.spp  <-mean.spp[order(alpha.grad),]

## community responses season2
plot(gradient2.season2, mean.spp[,"richness"]) ## explains trends with one outlier

m1 <- lm(richness~gradient1.season2, data=mean.spp)
summary(m1)
## 
## Call:
## lm(formula = richness ~ gradient1.season2, data = mean.spp)
## 
## Residuals:
##       11        9       14        8       10       12       13 
## -0.37132  0.12774  0.97167 -0.26409  0.13589 -0.07311 -0.52677 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)   
## (Intercept)        2.439002   0.417135   5.847  0.00207 **
## gradient1.season2 -0.006897   0.032506  -0.212  0.84034   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.5421 on 5 degrees of freedom
## Multiple R-squared:  0.008924,   Adjusted R-squared:  -0.1893 
## F-statistic: 0.04502 on 1 and 5 DF,  p-value: 0.8403
plot(gradient1.season2, mean.spp[,"abd"]) ## explains trends with one outlier

m2 <- lm(abd~gradient1.season2, data=mean.spp) ## trend
summary(m2)
## 
## Call:
## lm(formula = abd ~ gradient1.season2, data = mean.spp)
## 
## Residuals:
##      11       9      14       8      10      12      13 
##  30.369 -30.430  -6.459 -13.195   1.749  11.492   6.475 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)    
## (Intercept)        -47.123     16.291  -2.893 0.034083 *  
## gradient1.season2    9.138      1.270   7.198 0.000806 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 21.17 on 5 degrees of freedom
## Multiple R-squared:  0.912,  Adjusted R-squared:  0.8944 
## F-statistic: 51.82 on 1 and 5 DF,  p-value: 0.0008059
plot(gradient1.season2, mean.spp[,"biomass"]) ## explains trends with one outlier

m3 <- lm(biomass~gradient1.season2, data=mean.spp) ## trend
summary(m3)
## 
## Call:
## lm(formula = biomass ~ gradient1.season2, data = mean.spp)
## 
## Residuals:
##       11        9       14        8       10       12       13 
##  2.84669 -2.69808 -1.22403 -0.42398  0.18218  1.39556 -0.07834 
## 
## Coefficients:
##                   Estimate Std. Error t value Pr(>|t|)  
## (Intercept)        -2.3322     1.5019  -1.553    0.181  
## gradient1.season2   0.4507     0.1170   3.851    0.012 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.952 on 5 degrees of freedom
## Multiple R-squared:  0.7479, Adjusted R-squared:  0.6975 
## F-statistic: 14.83 on 1 and 5 DF,  p-value: 0.01199

RDA community and environmental data

community <- read.csv("Data/ERG.communitydata.csv")
community[is.na(community)] <- 0

##2016
## add enviro data to dataframe
comm2016 <- subset(community, Year==2016)
site.vars2016[,"Site"] <- as.factor(row.names(site.vars2016))
comm2016 <- merge(comm2016, site.vars2016, by="Site")

## transform spp data
community.trans <- decostand(comm2016[,13:53], "hellinger")

rda1 <- rda(community.trans, comm2016[,54:57])
(R2adj <- RsquareAdj(rda1)$adj.r.squared) ## 50.4% of variation explained
## [1] 0.4249994
## build byplot manually
par(mar=c(4.5,4.5,0.5,0.5))
plot(rda1, type="n", xlim=c(-1,1), ylim=c(-1.5,1.5))

## calculate priority
spp.priority <- colSums(comm2016[,13:53])

## plot RDA1
colvec <- rep(c("blue","dodgerblue3","cyan","yellow2","orange","tomato","red2"),each=60)
points(rda1, display = "sites", col = "black", pch = c(21), bg = colvec)
orditorp(rda1, display = "species", cex = 0.7, col = "darkred", priority=spp.priority, air=0.5)
text(rda1,  display = "bp", col = "blue", cex = 0.8) 
legend("bottomright", pch=c(21), legend=unique(comm2016$Site), pt.bg=unique(colvec), cex=1)

## ordikplot to adjust species locations

## 2017
## add enviro data to dataframe
comm2017 <- subset(community, Year==2017)
site.vars[,"Site"] <- as.factor(row.names(site.vars))
comm2017 <- merge(comm2017, site.vars, by="Site")
# 
# ## transform spp data
# community.trans <- decostand(comm2017[,13:53], "hellinger")
# 
# rda2 <- rda(community.trans, comm2017[,54:58])
# (R2adj <- RsquareAdj(rda2)$adj.r.squared) ## 50.4% of variation explained
# 
# 
# ## build byplot manually
# par(mar=c(4.5,4.5,0.5,0.5))
# plot(rda2, type="n", xlim=c(-1,1), ylim=c(-1.5,1.5))
# 
# ## calculate priority
# spp.priority <- colSums(comm2017[,13:53])
# 
# ## plot RDA2
# colvec <- rep(c("blue","dodgerblue3","cyan","yellow2","orange","tomato","red2"),each=60)
# points(rda2, display = "sites", col = "black", pch = c(21), bg = colvec)
# orditorp(rda2, display = "species", cex = 0.7, col = "darkred", priority=spp.priority, air=0.5)
# text(rda2,  display = "bp", col = "blue", cex = 0.8) 
# legend("bottomright", pch=c(21), legend=unique(comm2016$Site), pt.bg=unique(colvec), cex=1)
# ## ordikplot to adjust species locations

Phytometer analysis

census <- read.csv("Data/ERG.phytometer.census.csv")
census[is.na(census)] <- 0
census[,"phyto.abd"] <- rowSums(census[,c("Phacelia","Plantago","Salvia")])

## calculate the number of seeds per gram
seed.mass <- read.csv("Data/seed.mass.csv")
seed.mass.avg <- seed.mass %>% group_by(species) %>%  summarize(avg.seed.gram=mean(seed.number),se.seed.gram=se(seed.number))
seed.mass.avg <- data.frame(seed.mass.avg)
seed.mass.avg
##      species avg.seed.gram se.seed.gram
## 1   Amsinkia         235.2     7.611833
## 2 Caulanthus        3019.0     8.916277
## 3  Lipidium          752.4     4.261455
## 4 Monolopia          737.8     7.831986
## 5   Phacelia         772.0     5.300943
## 6   Plantago         558.2     6.865858
## 7     Salvia         980.0     9.612492
## get proportion of seed germinated per 0.3 grams of seed
census[,"Phacelia.prop"] <- census[,"Phacelia"]/(seed.mass.avg$avg.seed.gram[which(seed.mass.avg$species=="Phacelia")]*0.3)
census[,"Plantago.prop"] <- census[,"Plantago"]/(seed.mass.avg$avg.seed.gram[which(seed.mass.avg$species=="Plantago")]*0.3)
census[,"Salvia.prop"] <- census[,"Salvia"]/(seed.mass.avg$avg.seed.gram[which(seed.mass.avg$species=="Salvia")]*0.3)


## beginning
census.int <- subset(census, Census=="emergence")

## all species
m1 <- glm.nb(Phacelia~ Microsite * Nutrient * Site + Year, data=census.int)
anova(m1, test="Chisq") ## Site * Micro and Year significant
## Analysis of Deviance Table
## 
## Model: Negative Binomial(0.8108), link: log
## 
## Response: Phacelia
## 
## Terms added sequentially (first to last)
## 
## 
##                         Df Deviance Resid. Df Resid. Dev  Pr(>Chi)    
## NULL                                      839    1079.71              
## Microsite                1   10.304       838    1069.41  0.001328 ** 
## Nutrient                 1    1.234       837    1068.17  0.266538    
## Site                     6  159.651       831     908.52 < 2.2e-16 ***
## Year                     1   31.424       830     877.10 2.073e-08 ***
## Microsite:Nutrient       1    0.046       829     877.05  0.829874    
## Microsite:Site           6   21.032       823     856.02  0.001811 ** 
## Nutrient:Site            6    5.542       817     850.48  0.476389    
## Microsite:Nutrient:Site  6    8.030       811     842.45  0.235879    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Phacelia
m1 <- glm.nb(Phacelia~ Microsite * Nutrient * Site + Year, data=census.int)
anova(m1, test="Chisq") ## Site * Micro and Year significant
## Analysis of Deviance Table
## 
## Model: Negative Binomial(0.8108), link: log
## 
## Response: Phacelia
## 
## Terms added sequentially (first to last)
## 
## 
##                         Df Deviance Resid. Df Resid. Dev  Pr(>Chi)    
## NULL                                      839    1079.71              
## Microsite                1   10.304       838    1069.41  0.001328 ** 
## Nutrient                 1    1.234       837    1068.17  0.266538    
## Site                     6  159.651       831     908.52 < 2.2e-16 ***
## Year                     1   31.424       830     877.10 2.073e-08 ***
## Microsite:Nutrient       1    0.046       829     877.05  0.829874    
## Microsite:Site           6   21.032       823     856.02  0.001811 ** 
## Nutrient:Site            6    5.542       817     850.48  0.476389    
## Microsite:Nutrient:Site  6    8.030       811     842.45  0.235879    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Plantago
m2 <- glm.nb(Plantago~ Microsite * Nutrient * Site + Year, data=census.int)
anova(m2, test="Chisq") ## Site * Micro and Year significant
## Analysis of Deviance Table
## 
## Model: Negative Binomial(0.5335), link: log
## 
## Response: Plantago
## 
## Terms added sequentially (first to last)
## 
## 
##                         Df Deviance Resid. Df Resid. Dev  Pr(>Chi)    
## NULL                                      839     984.30              
## Microsite                1    6.256       838     978.04   0.01238 *  
## Nutrient                 1    1.060       837     976.98   0.30332    
## Site                     6  162.687       831     814.30 < 2.2e-16 ***
## Year                     1    4.138       830     810.16   0.04194 *  
## Microsite:Nutrient       1    2.388       829     807.77   0.12224    
## Microsite:Site           6   43.000       823     764.77 1.167e-07 ***
## Nutrient:Site            6    6.391       817     758.38   0.38088    
## Microsite:Nutrient:Site  6    4.615       811     753.77   0.59403    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Salvia
m3 <- glm.nb(Salvia~ Microsite * Nutrient * Site + Year, data=census.int)
anova(m3, test="Chisq") ## Site * Micro and Year significant + (micro x nutrient)
## Analysis of Deviance Table
## 
## Model: Negative Binomial(0.8273), link: log
## 
## Response: Salvia
## 
## Terms added sequentially (first to last)
## 
## 
##                         Df Deviance Resid. Df Resid. Dev  Pr(>Chi)    
## NULL                                      839    1210.25              
## Microsite                1    5.924       838    1204.33 0.0149386 *  
## Nutrient                 1    1.513       837    1202.82 0.2186678    
## Site                     6  211.625       831     991.19 < 2.2e-16 ***
## Year                     1   17.463       830     973.73 2.929e-05 ***
## Microsite:Nutrient       1    7.824       829     965.90 0.0051548 ** 
## Microsite:Site           6   26.421       823     939.48 0.0001858 ***
## Nutrient:Site            6    4.587       817     934.90 0.5977624    
## Microsite:Nutrient:Site  6    1.566       811     933.33 0.9549811    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
census.int.plot <- gather(census.int, species, abundance, Phacelia:Salvia)

##calculate confidence interval
census.plot<- census.int.plot %>%  group_by(Microsite, species, Site, Year) %>%  summarize(avg=mean(abundance),ci=se(abundance)*1.96)

ggplot(census.plot, aes(x=Microsite, y=avg, fill=species))+
  geom_bar(position=position_dodge(), stat="identity")+
   geom_errorbar(aes(ymin=avg-ci, ymax=avg+ci),
                  width=.2,                    # Width of the error bars
                  position=position_dodge(.9))+ scale_fill_brewer() +ylab("Abundance")+ theme_Publication() + facet_grid(Year~Site) 

## end season
census.end <- subset(census, Census=="end")
census.end[,"Year"] <- as.factor(census.end$Year)

## run full model for phyto biomass
m1 <- aov(log(phyto.biomass)~ Site * Microsite * Nutrient + Year, data=subset(census.end, phyto.biomass>0))
summary(m1)
##                          Df Sum Sq Mean Sq F value   Pr(>F)    
## Site                      6  330.8   55.13  32.164  < 2e-16 ***
## Microsite                 1   10.9   10.88   6.347 0.012127 *  
## Nutrient                  1   30.3   30.25  17.651 3.24e-05 ***
## Year                      1  161.2  161.21  94.051  < 2e-16 ***
## Site:Microsite            6   23.9    3.99   2.327 0.031940 *  
## Site:Nutrient             6   41.9    6.98   4.073 0.000551 ***
## Microsite:Nutrient        1    1.7    1.73   1.011 0.315196    
## Site:Microsite:Nutrient   6    7.9    1.32   0.768 0.595068    
## Residuals               424  726.7    1.71                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(m1, "Microsite")
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = log(phyto.biomass) ~ Site * Microsite * Nutrient + Year, data = subset(census.end, phyto.biomass > 0))
## 
## $Microsite
##                 diff        lwr       upr     p adj
## shrub-open 0.3096905 0.06750868 0.5518722 0.0123243
## all species end of season
m2 <- glm.nb(phyto.abd~ Microsite * Nutrient * Site + Year, data=census.end)
anova(m2, test="Chisq") ## Site and microsite*nutrient significant
## Analysis of Deviance Table
## 
## Model: Negative Binomial(0.455), link: log
## 
## Response: phyto.abd
## 
## Terms added sequentially (first to last)
## 
## 
##                         Df Deviance Resid. Df Resid. Dev Pr(>Chi)    
## NULL                                      839    1009.51             
## Microsite                1    1.059       838    1008.45  0.30341    
## Nutrient                 1    2.527       837    1005.92  0.11194    
## Site                     6  135.420       831     870.50  < 2e-16 ***
## Year                     1    3.412       830     867.09  0.06474 .  
## Microsite:Nutrient       1    4.586       829     862.50  0.03224 *  
## Microsite:Site           6    5.340       823     857.16  0.50104    
## Nutrient:Site            6    5.169       817     852.00  0.52238    
## Microsite:Nutrient:Site  6    5.683       811     846.31  0.45956    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## run full model for phacelia biomass
m3 <- aov(log(Phacelia.biomass)~ Site * Microsite * Nutrient + Year, data=subset(census.end, Phacelia.biomass>0))
summary(m3) ## site and microsite
##                          Df Sum Sq Mean Sq F value   Pr(>F)    
## Site                      6   89.7   14.95   8.274 4.95e-08 ***
## Microsite                 1   21.2   21.20  11.738  0.00074 ***
## Nutrient                  1   10.2   10.19   5.642  0.01845 *  
## Year                      1   95.5   95.49  52.857 7.42e-12 ***
## Site:Microsite            6   23.6    3.93   2.173  0.04692 *  
## Site:Nutrient             6    8.0    1.34   0.742  0.61612    
## Microsite:Nutrient        1    0.0    0.00   0.001  0.97552    
## Site:Microsite:Nutrient   5    4.1    0.82   0.452  0.81122    
## Residuals               205  370.3    1.81                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(m3, "Microsite")
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = log(Phacelia.biomass) ~ Site * Microsite * Nutrient + Year, data = subset(census.end, Phacelia.biomass > 0))
## 
## $Microsite
##                 diff       lwr       upr     p adj
## shrub-open 0.6312547 0.2667053 0.9958041 0.0007714
## run full model for plantago biomass
m4 <- aov(log(Plantago.biomass)~ Site * Microsite * Nutrient + Year, data=subset(census.end, Plantago.biomass>0))
summary(m4) ## site and year + sitexmicrosite
##                          Df Sum Sq Mean Sq F value   Pr(>F)    
## Site                      6 116.35   19.39  19.843 2.32e-16 ***
## Microsite                 1   1.96    1.96   2.001    0.160    
## Nutrient                  1  32.03   32.03  32.778 6.80e-08 ***
## Year                      1 138.38  138.38 141.597  < 2e-16 ***
## Site:Microsite            6   4.87    0.81   0.830    0.549    
## Site:Nutrient             4   1.99    0.50   0.508    0.730    
## Microsite:Nutrient        1   3.17    3.17   3.244    0.074 .  
## Site:Microsite:Nutrient   3   0.65    0.22   0.220    0.882    
## Residuals               130 127.05    0.98                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(m4, "Microsite")
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = log(Plantago.biomass) ~ Site * Microsite * Nutrient + Year, data = subset(census.end, Plantago.biomass > 0))
## 
## $Microsite
##                  diff        lwr       upr     p adj
## shrub-open -0.2179629 -0.5348829 0.0989571 0.1759823
## run full model for plantago biomass
m5 <- aov(log(Salvia.biomass)~ Site * Microsite * Nutrient + Year, data=subset(census.end, Salvia.biomass>0))
summary(m5) ## site and year + sitexmicrosite
##                          Df Sum Sq Mean Sq F value   Pr(>F)    
## Site                      6  170.1   28.35  19.982  < 2e-16 ***
## Microsite                 1    0.0    0.01   0.008 0.929221    
## Nutrient                  1   21.4   21.43  15.103 0.000124 ***
## Year                      1   44.1   44.05  31.045 5.39e-08 ***
## Site:Microsite            6    6.8    1.14   0.802 0.568988    
## Site:Nutrient             6   46.2    7.70   5.424 2.35e-05 ***
## Microsite:Nutrient        1    0.5    0.55   0.387 0.534459    
## Site:Microsite:Nutrient   6   12.9    2.16   1.520 0.171069    
## Residuals               317  449.8    1.42                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(m5, "Microsite")
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = log(Salvia.biomass) ~ Site * Microsite * Nutrient + Year, data = subset(census.end, Salvia.biomass > 0))
## 
## $Microsite
##                  diff        lwr       upr     p adj
## shrub-open 0.01133515 -0.2406604 0.2633307 0.9295351
## run full model for phacelia abundance
m6 <- glm.nb(Phacelia.biomass~ Site * Microsite * Nutrient + Year, data=subset(census.end, Phacelia>0))
summary(m3) ## site and microsite
##                          Df Sum Sq Mean Sq F value   Pr(>F)    
## Site                      6   89.7   14.95   8.274 4.95e-08 ***
## Microsite                 1   21.2   21.20  11.738  0.00074 ***
## Nutrient                  1   10.2   10.19   5.642  0.01845 *  
## Year                      1   95.5   95.49  52.857 7.42e-12 ***
## Site:Microsite            6   23.6    3.93   2.173  0.04692 *  
## Site:Nutrient             6    8.0    1.34   0.742  0.61612    
## Microsite:Nutrient        1    0.0    0.00   0.001  0.97552    
## Site:Microsite:Nutrient   5    4.1    0.82   0.452  0.81122    
## Residuals               205  370.3    1.81                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(m3, "Microsite")
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = log(Phacelia.biomass) ~ Site * Microsite * Nutrient + Year, data = subset(census.end, Phacelia.biomass > 0))
## 
## $Microsite
##                 diff       lwr       upr     p adj
## shrub-open 0.6312547 0.2667053 0.9958041 0.0007714
## run full model for plantago biomass
m7 <- aov(log(Plantago)~ Site * Microsite * Nutrient + Year, data=subset(census.end, Plantago>0))
summary(m4) ## site and year + sitexmicrosite
##                          Df Sum Sq Mean Sq F value   Pr(>F)    
## Site                      6 116.35   19.39  19.843 2.32e-16 ***
## Microsite                 1   1.96    1.96   2.001    0.160    
## Nutrient                  1  32.03   32.03  32.778 6.80e-08 ***
## Year                      1 138.38  138.38 141.597  < 2e-16 ***
## Site:Microsite            6   4.87    0.81   0.830    0.549    
## Site:Nutrient             4   1.99    0.50   0.508    0.730    
## Microsite:Nutrient        1   3.17    3.17   3.244    0.074 .  
## Site:Microsite:Nutrient   3   0.65    0.22   0.220    0.882    
## Residuals               130 127.05    0.98                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(m4, "Microsite")
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = log(Plantago.biomass) ~ Site * Microsite * Nutrient + Year, data = subset(census.end, Plantago.biomass > 0))
## 
## $Microsite
##                  diff        lwr       upr     p adj
## shrub-open -0.2179629 -0.5348829 0.0989571 0.1759823
## run full model for plantago biomass
m8 <- aov(log(Salvia)~ Site * Microsite * Nutrient + Year, data=subset(census.end, Salvia>0))
summary(m5) ## site and year + sitexmicrosite
##                          Df Sum Sq Mean Sq F value   Pr(>F)    
## Site                      6  170.1   28.35  19.982  < 2e-16 ***
## Microsite                 1    0.0    0.01   0.008 0.929221    
## Nutrient                  1   21.4   21.43  15.103 0.000124 ***
## Year                      1   44.1   44.05  31.045 5.39e-08 ***
## Site:Microsite            6    6.8    1.14   0.802 0.568988    
## Site:Nutrient             6   46.2    7.70   5.424 2.35e-05 ***
## Microsite:Nutrient        1    0.5    0.55   0.387 0.534459    
## Site:Microsite:Nutrient   6   12.9    2.16   1.520 0.171069    
## Residuals               317  449.8    1.42                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(m5, "Microsite")
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = log(Salvia.biomass) ~ Site * Microsite * Nutrient + Year, data = subset(census.end, Salvia.biomass > 0))
## 
## $Microsite
##                  diff        lwr       upr     p adj
## shrub-open 0.01133515 -0.2406604 0.2633307 0.9295351
census.end.plot <- gather(census.end, species, biomass, Phacelia.biomass:Salvia.biomass)

##calculate confidence interval
census.plot<- census.end.plot %>%  group_by(Microsite, species, Site, Year) %>%  summarize(avg=mean(biomass),ci=se(biomass)*1.96)

ggplot(census.plot, aes(x=Microsite, y=avg, fill=species))+
  geom_bar(position=position_dodge(), stat="identity")+
   geom_errorbar(aes(ymin=avg-ci, ymax=avg+ci),
                  width=.2,                    # Width of the error bars
                  position=position_dodge(.9))+ scale_fill_brewer() +ylab("Abundance")+ theme_Publication() + facet_grid(Year~Site) 

### RDA
# 
# ##collect environmental variables for site
# nutrients <- read.csv("Data/ERG.soilnutrients.csv")
# nutrients.mean <- nutrients %>% group_by(gradient,site, microsite) %>% summarise_each(funs(mean))
# nutrients.vars <- data.frame(nutrients.mean)
# 
# ## minimum explanation of variables
# ambient2016[is.na(ambient2016)] <- 0
# community <- ambient2016 %>% group_by(Gradient,Site, Microsite) %>% summarise_each(funs(sum))
# community <- data.frame(community)
# 
# end.census <- subset(census2016, census=="end")
# end.census  <- end.census  %>% group_by(Gradient,Site, Microsite) %>% summarise_each(funs(mean))
# end.census<- data.frame(end.census)
# 
# ## daily means
# day.mean <- aggregate(HOBO.data, by=list(day=HOBO.data$Day, micro=HOBO.data$Microsite, site=HOBO.data$Site), mean)
# 
# ## summarize daily means across sites
# means <- day.mean %>% group_by(gradient, micro) %>% summarize(temp=mean(Temp),rh=mean(RH),temp.se=se(Temp),rh.se=se(RH))
# means <- data.frame(means)
# 
# 
# envs <- data.frame(swc=end.census[,"swc"],nutrients.vars[,c("N","P","K")], means[,c("temp","rh")])
# 
# ## hellinger transformation
# community.trans <- decostand(community[,12:42], "hellinger")
# 
# ## rda with environmental variables
# rda1 <- rda(community.trans, envs)
# anova(rda1)
# (R2adj <- RsquareAdj(rda1)$adj.r.squared) ## 25.7% of variation explained
# 
# 
# ## build byplot manually
# par(mar=c(4.5,4.5,0.5,0.5))
# plot(rda1, type="n", xlim=c(-1,1))
# 
# with(community, levels(Site))
# 
# spp.priority <- colSums(community[,12:42])
# 
# colvec <- c("blue","dodgerblue3","cyan","yellow2","orange","tomato","red2")
# with(community, points(rda1, display = "sites", col = "black", pch = c(21,22), bg = colvec[Site]))
# orditorp(rda1, display = "species", cex = 0.7, col = "darkred", priority=spp.priority, air=1,)
# text(rda1,  display = "bp", col = "blue", cex = 0.8) 
# legend("bottomright", pch=c(21), legend=community$Site[community$Microsite=="shrub"], pt.bg=colvec, cex=1)
# 
# ## check variable explanation
# vif.cca(rda1)
# 
# v.clim <- cbind(envs[,c("temp","rh")])
# v.nut <- cbind(envs[,c("N","P","K")])
# v.swc <- envs[,"swc"]
# 
# x <- varpart(community.trans,v.clim,v.nut,v.swc)
# 
# showvarparts(3)

Difference in effect size

library(bootES)
## Loading required package: boot
## 
## Attaching package: 'boot'
## The following object is masked from 'package:lattice':
## 
##     melanoma
effect.cal <- function(x){ bootES(x, R=999, data.col="Biomass", group.col="Microsite", contrast=c(shrub=1,open=-1), effect.type=c("cohens.d"))}

effect.site <- by(subset(comm2016, Site != "Barstow"), comm2016$Site[comm2016$Site != "Barstow"], FUN=effect.cal)

site.summary <- rbind(summary(effect.site$Panoche),summary(effect.site$Cuyama),summary(effect.site$TejonRanch),data.frame(stat=0,ci.low=0,ci.high=0,bias=0,std.error=0),summary(effect.site$MojavePreserve),summary(effect.site$SheepholeValley),summary(effect.site$Tecopa)) 
site.summary[5,] <- 0
site.summary <- sapply(site.summary, as.numeric)

par(mar=c(4.5,4.5,.5,.5))
plot(c(1:7),site.summary[,"stat"], xlim=c(0.5,7.5), ylim=c(-1,3), pch=19, cex=1.4, ylab="Hedge's G", xlab="", xaxt="n")
arrows(c(1:7),as.numeric(site.summary[,"ci.high"]),c(1:7),site.summary[,"ci.low"], angle=90, code=3, length=0, lwd=2)
abline(h=0, lty=2, lwd=2)
axis(1, c(1:7), labels=site.names, cex.axis=1)

## phytometer

effect.cal <- function(x){ bootES(x, R=999, data.col="phyto.biomass", group.col="Microsite", contrast=c(shrub=1,open=-1), effect.type=c("cohens.d"))}

census2016 <- subset(census, Census=="end" & Year ==2016)

effect.site <- by(subset(census2016, Site != "Barstow"), census2016$Site[census2016$Site != "Barstow"], FUN=effect.cal)

site.summary <- rbind(summary(effect.site$Panoche),summary(effect.site$Cuyama),summary(effect.site$TejonRanch),data.frame(stat=0,ci.low=0,ci.high=0,bias=0,std.error=0),summary(effect.site$MojavePreserve),summary(effect.site$SheepholeValley),summary(effect.site$Tecopa)) 
site.summary <- sapply(site.summary, as.numeric)

par(mar=c(4.5,4.5,.5,.5))
plot(c(1:7),site.summary[,"stat"], xlim=c(0.5,7.5), ylim=c(-1,3), pch=19, cex=1.4, ylab="Hedge's G", xlab="", xaxt="n")
arrows(c(1:7),site.summary[,"ci.high"],c(1:7),site.summary[,"ci.low"], angle=90, code=3, length=0, lwd=2)
abline(h=0, lty=2, lwd=2)
axis(1, c(1:7), labels=site.names, cex.axis=1)

Rii between years

rii <- function(x, j, var)
{
s1 <- subset(x, Microsite == "shrub", select=var)
o1 <- subset(x, Microsite == "open", select=var)
return1 <- (s1 - o1) / (s1+o1)
x1 <- x[seq(1, nrow(x), by = 2),]
return2 <- cbind(x1[j], return1)
return2[is.na(return2)] <- 0
print(return2)
}


rii.dat <- rii(community, j=1:8, var=c("Abundance","Richness","Biomass"))
##     Year  ID            Site Rep      Lat      Long Elevation Gradient
## 1   2017   1    PanocheHills   1 36.70001 -120.8011  656.3209        1
## 3   2017   2    PanocheHills   2 36.70005 -120.8012  656.1902        1
## 5   2017   3    PanocheHills   3 36.70010 -120.8015  656.6475        1
## 7   2017   4    PanocheHills   4 36.70012 -120.8014  657.3752        1
## 9   2017   5    PanocheHills   5 36.70019 -120.8016  656.5075        1
## 11  2017   6    PanocheHills   6 36.70026 -120.8014  655.5837        1
## 13  2017   7    PanocheHills   7 36.70037 -120.8014  655.4344        1
## 15  2017   8    PanocheHills   8 36.70045 -120.8015  655.3132        1
## 17  2017   9    PanocheHills   9 36.70052 -120.8015  655.0519        1
## 19  2017  10    PanocheHills  10 36.70044 -120.8016  655.5371        1
## 21  2017  11    PanocheHills  11 36.70057 -120.8017  656.4329        1
## 23  2017  12    PanocheHills  12 36.70063 -120.8019  657.0300        1
## 25  2017  13    PanocheHills  13 36.70060 -120.8020  657.1606        1
## 27  2017  14    PanocheHills  14 36.70064 -120.8017  656.7687        1
## 29  2017  15    PanocheHills  15 36.70064 -120.8022  657.2166        1
## 31  2017  16    PanocheHills  16 36.70074 -120.8022  656.9554        1
## 33  2017  17    PanocheHills  17 36.70086 -120.8022  656.0223        1
## 35  2017  18    PanocheHills  18 36.70080 -120.8023  656.5541        1
## 37  2017  19    PanocheHills  19 36.70073 -120.8024  656.1996        1
## 39  2017  20    PanocheHills  20 36.70069 -120.8023  655.4438        1
## 41  2017  21    PanocheHills  21 36.70053 -120.8023  655.8543        1
## 43  2017  22    PanocheHills  22 36.70048 -120.8021  657.1420        1
## 45  2017  23    PanocheHills  23 36.70042 -120.8021  657.7485        1
## 47  2017  24    PanocheHills  24 36.70036 -120.8020  658.2523        1
## 49  2017  25    PanocheHills  25 36.70035 -120.8019  658.7189        1
## 51  2017  26    PanocheHills  26 36.70026 -120.8020  658.9055        1
## 53  2017  27    PanocheHills  27 36.70013 -120.8020  658.9988        1
## 55  2017  28    PanocheHills  28 36.70015 -120.8020  659.0361        1
## 57  2017  29    PanocheHills  29 36.70009 -120.8019  658.9614        1
## 59  2017  30    PanocheHills  30 36.70005 -120.8019  659.1201        1
## 61  2017  31          Cuyama   1 34.85522 -119.4885  806.8343        2
## 63  2017  32          Cuyama   2 34.85518 -119.4886  806.5264        2
## 65  2017  33          Cuyama   3 34.85512 -119.4886  806.4984        2
## 67  2017  34          Cuyama   4 34.85506 -119.4885  806.6196        2
## 69  2017  35          Cuyama   5 34.85505 -119.4884  807.0115        2
## 71  2017  36          Cuyama   6 34.85500 -119.4884  806.0505        2
## 73  2017  37          Cuyama   7 34.85489 -119.4885  808.0753        2
## 75  2017  38          Cuyama   8 34.85488 -119.4884  808.7097        2
## 77  2017  39          Cuyama   9 34.85489 -119.4883  808.5231        2
## 79  2017  40          Cuyama  10 34.85476 -119.4884  809.9227        2
## 81  2017  41          Cuyama  11 34.85462 -119.4885  809.3256        2
## 83  2017  42          Cuyama  12 34.85465 -119.4884  809.5961        2
## 85  2017  43          Cuyama  13 34.85454 -119.4884  810.1840        2
## 87  2017  44          Cuyama  14 34.85442 -119.4884  809.8107        2
## 89  2017  45          Cuyama  15 34.85441 -119.4882  810.0720        2
## 91  2017  46          Cuyama  16 34.85436 -119.4881  810.3986        2
## 93  2017  47          Cuyama  17 34.85443 -119.4880  810.0161        2
## 95  2017  48          Cuyama  18 34.85449 -119.4880  811.1917        2
## 97  2017  49          Cuyama  19 34.85461 -119.4879  811.6675        2
## 99  2017  50          Cuyama  20 34.85472 -119.4878  809.8854        2
## 101 2017  51          Cuyama  21 34.85472 -119.4877  810.4172        2
## 103 2017  52          Cuyama  22 34.85484 -119.4876  811.3410        2
## 105 2017  53          Cuyama  23 34.85492 -119.4874  810.9584        2
## 107 2017  54          Cuyama  24 34.85496 -119.4873  811.6302        2
## 109 2017  55          Cuyama  25 34.85500 -119.4874  811.9008        2
## 111 2017  56          Cuyama  26 34.85510 -119.4875  812.1807        2
## 113 2017  57          Cuyama  27 34.85511 -119.4876  812.1248        2
## 115 2017  58          Cuyama  28 34.85508 -119.4876  812.6193        2
## 117 2017  59          Cuyama  29 34.85499 -119.4879  811.4623        2
## 119 2017  60          Cuyama  30 34.85502 -119.4881  811.7795        2
## 121 2017  61         Barstow   1 35.09405 -116.8349  496.0200        4
## 123 2017  62         Barstow   2 35.09391 -116.8348  496.1690        4
## 125 2017  63         Barstow   3 35.09381 -116.8349  495.4130        4
## 127 2017  64         Barstow   4 35.09373 -116.8350  495.4600        4
## 129 2017  65         Barstow   5 35.09372 -116.8350  494.9840        4
## 131 2017  66         Barstow   6 35.09361 -116.8350  494.7600        4
## 133 2017  67         Barstow   7 35.09359 -116.8351  495.0870        4
## 135 2017  68         Barstow   8 35.09358 -116.8351  495.1050        4
## 137 2017  69         Barstow   9 35.09353 -116.8351  495.1520        4
## 139 2017  70         Barstow  10 35.09342 -116.8350  494.9280        4
## 141 2017  71         Barstow  11 35.09338 -116.8352  494.8630        4
## 143 2017  72         Barstow  12 35.09336 -116.8351  494.9000        4
## 145 2017  73         Barstow  13 35.09332 -116.8351  494.8910        4
## 147 2017  74         Barstow  14 35.09325 -116.8352  494.5830        4
## 149 2017  75         Barstow  15 35.09318 -116.8352  495.0680        4
## 151 2017  76         Barstow  16 35.09313 -116.8352  494.8810        4
## 153 2017  77         Barstow  17 35.09310 -116.8353  494.6010        4
## 155 2017  78         Barstow  18 35.09299 -116.8352  494.1160        4
## 157 2017  79         Barstow  19 35.09289 -116.8352  493.9670        4
## 159 2017  80         Barstow  20 35.09276 -116.8352  493.7340        4
## 161 2017  81         Barstow  21 35.09275 -116.8351  573.0444        4
## 163 2017  82         Barstow  22 35.09271 -116.8350  572.1393        4
## 165 2017  83         Barstow  23 35.09280 -116.8349  572.9885        4
## 167 2017  84         Barstow  24 35.09275 -116.8348  572.3166        4
## 169 2017  85         Barstow  25 35.09280 -116.8347  571.7568        4
## 171 2017  86         Barstow  26 35.09287 -116.8348  571.9061        4
## 173 2017  87         Barstow  27 35.09290 -116.8346  571.6915        4
## 175 2017  88         Barstow  28 35.09295 -116.8345  571.9341        4
## 177 2017  89         Barstow  29 35.09302 -116.8347  571.4862        4
## 179 2017  90         Barstow  30 35.09311 -116.8347  571.7195        4
## 181 2017  91   HeartofMojave   1 34.69820 -115.6842  784.7300        5
## 183 2017  92   HeartofMojave   2 34.69811 -115.6841  784.6460        5
## 185 2017  93   HeartofMojave   3 34.69805 -115.6841  784.8510        5
## 187 2017  94   HeartofMojave   4 34.69798 -115.6841  784.8330        5
## 189 2017  95   HeartofMojave   5 34.69792 -115.6841  784.5530        5
## 191 2017  96   HeartofMojave   6 34.69794 -115.6843  784.2630        5
## 193 2017  97   HeartofMojave   7 34.69789 -115.6843  784.3660        5
## 195 2017  98   HeartofMojave   8 34.69784 -115.6844  784.2350        5
## 197 2017  99   HeartofMojave   9 34.69782 -115.6843  783.9930        5
## 199 2017 100   HeartofMojave  10 34.69779 -115.6844  783.2460        5
## 201 2017 101   HeartofMojave  11 34.69776 -115.6843  783.0600        5
## 203 2017 102   HeartofMojave  12 34.69772 -115.6844  783.0410        5
## 205 2017 103   HeartofMojave  13 34.69762 -115.6844  783.1720        5
## 207 2017 104   HeartofMojave  14 34.69764 -115.6845  782.6680        5
## 209 2017 105   HeartofMojave  15 34.69756 -115.6844  782.5840        5
## 211 2017 106   HeartofMojave  16 34.69747 -115.6843  781.8750        5
## 213 2017 107   HeartofMojave  17 34.69735 -115.6843  783.0130        5
## 215 2017 108   HeartofMojave  18 34.69730 -115.6843  782.3690        5
## 217 2017 109   HeartofMojave  19 34.69718 -115.6843  781.3430        5
## 219 2017 110   HeartofMojave  20 34.69714 -115.6843  781.0820        5
## 221 2017 111   HeartofMojave  21 34.69721 -115.6842  770.7805        5
## 223 2017 112   HeartofMojave  22 34.69729 -115.6841  770.9671        5
## 225 2017 113   HeartofMojave  23 34.69745 -115.6838  773.9343        5
## 227 2017 114   HeartofMojave  24 34.69748 -115.6838  773.0945        5
## 229 2017 115   HeartofMojave  25 34.69748 -115.6837  773.9996        5
## 231 2017 116   HeartofMojave  26 34.69755 -115.6837  774.5034        5
## 233 2017 117   HeartofMojave  27 34.69761 -115.6836  774.8766        5
## 235 2017 118   HeartofMojave  28 34.69764 -115.6836  775.0259        5
## 237 2017 119   HeartofMojave  29 34.69769 -115.6837  774.9606        5
## 239 2017 120   HeartofMojave  30 34.69772 -115.6837  775.0726        5
## 241 2017 121 SheepholeValley   1 34.20568 -115.7197  545.9200        6
## 243 2017 122 SheepholeValley   2 34.20574 -115.7195  546.5730        6
## 245 2017 123 SheepholeValley   3 34.20565 -115.7194  546.6290        6
## 247 2017 124 SheepholeValley   4 34.20559 -115.7192  546.2470        6
## 249 2017 125 SheepholeValley   5 34.20563 -115.7192  546.5170        6
## 251 2017 126 SheepholeValley   6 34.20558 -115.7190  546.2930        6
## 253 2017 127 SheepholeValley   7 34.20561 -115.7190  545.8920        6
## 255 2017 128 SheepholeValley   8 34.20555 -115.7190  545.7430        6
## 257 2017 129 SheepholeValley   9 34.20572 -115.7188  546.5080        6
## 259 2017 130 SheepholeValley  10 34.20577 -115.7187  546.9090        6
## 261 2017 131 SheepholeValley  11 34.20580 -115.7186  547.1330        6
## 263 2017 132 SheepholeValley  12 34.20594 -115.7186  547.8890        6
## 265 2017 133 SheepholeValley  13 34.20611 -115.7187  548.4580        6
## 267 2017 134 SheepholeValley  14 34.20626 -115.7190  549.5310        6
## 269 2017 135 SheepholeValley  15 34.20632 -115.7192  550.0070        6
## 271 2017 136 SheepholeValley  16 34.20631 -115.7194  550.3800        6
## 273 2017 137 SheepholeValley  17 34.20628 -115.7196  549.9420        6
## 275 2017 138 SheepholeValley  18 34.20625 -115.7196  550.1560        6
## 277 2017 139 SheepholeValley  19 34.20627 -115.7197  549.4560        6
## 279 2017 140 SheepholeValley  20 34.20618 -115.7198  549.1950        6
## 281 2017 141 SheepholeValley  21 34.20650 -115.7194  598.3586        6
## 283 2017 142 SheepholeValley  22 34.20652 -115.7192  597.8641        6
## 285 2017 143 SheepholeValley  23 34.20664 -115.7191  599.4130        6
## 287 2017 144 SheepholeValley  24 34.20678 -115.7192  600.1594        6
## 289 2017 145 SheepholeValley  25 34.20664 -115.7192  597.9014        6
## 291 2017 146 SheepholeValley  26 34.20659 -115.7193  597.4069        6
## 293 2017 147 SheepholeValley  27 34.20659 -115.7195  595.8207        6
## 295 2017 148 SheepholeValley  28 34.20658 -115.7198  595.4101        6
## 297 2017 149 SheepholeValley  29 34.20655 -115.7199  595.5687        6
## 299 2017 150 SheepholeValley  30 34.20661 -115.7199  596.3432        6
## 301 2017 151          Tecopa   1 35.85152 -116.1867  699.4567        7
## 303 2017 152          Tecopa   2 35.85145 -116.1867  699.5779        7
## 305 2017 153          Tecopa   3 35.85141 -116.1867  700.2591        7
## 307 2017 154          Tecopa   4 35.85134 -116.1866  700.8936        7
## 309 2017 155          Tecopa   5 35.85130 -116.1866  700.1472        7
## 311 2017 156          Tecopa   6 35.85127 -116.1866  699.6806        7
## 313 2017 157          Tecopa   7 35.85121 -116.1866  700.7536        7
## 315 2017 158          Tecopa   8 35.85118 -116.1865  700.9216        7
## 317 2017 159          Tecopa   9 35.85117 -116.1864  702.2092        7
## 319 2017 160          Tecopa  10 35.85127 -116.1863  702.9650        7
## 321 2017 161          Tecopa  11 35.85123 -116.1862  702.8064        7
## 323 2017 162          Tecopa  12 35.85118 -116.1863  704.1033        7
## 325 2017 163          Tecopa  13 35.85115 -116.1864  704.3740        7
## 327 2017 164          Tecopa  14 35.85108 -116.1865  705.4656        7
## 329 2017 165          Tecopa  15 35.85108 -116.1866  705.0178        7
## 331 2017 166          Tecopa  16 35.85102 -116.1866  706.5200        7
## 333 2017 167          Tecopa  17 35.85116 -116.1867  706.6413        7
## 335 2017 168          Tecopa  18 35.85123 -116.1867  707.5930        7
## 337 2017 169          Tecopa  19 35.85124 -116.1868  707.6583        7
## 339 2017 170          Tecopa  20 35.85130 -116.1869  445.7271        7
## 341 2017 171          Tecopa  21 35.85133 -116.1868  446.2497        7
## 343 2017 172          Tecopa  22 35.85140 -116.1869  447.1734        7
## 345 2017 173          Tecopa  23 35.85145 -116.1869  447.4533        7
## 347 2017 174          Tecopa  24 35.85146 -116.1868  448.7690        7
## 349 2017 175          Tecopa  25 35.85150 -116.1868  448.7130        7
## 351 2017 176          Tecopa  26 35.85152 -116.1869  449.0116        7
## 353 2017 177          Tecopa  27 35.85147 -116.1869  447.8639        7
## 355 2017 178          Tecopa  28 35.85153 -116.1870  449.0209        7
## 357 2017 179          Tecopa  29 35.85168 -116.1870  448.9182        7
## 359 2017 180          Tecopa  30 35.85101 -116.1872  449.0209        7
## 361 2017 181      TejonRanch   1 34.87599 -118.6025 1118.0220        3
## 363 2017 182      TejonRanch   2 34.87595 -118.6025 1118.0500        3
## 365 2017 183      TejonRanch   3 34.87593 -118.6025 1117.6300        3
## 367 2017 184      TejonRanch   4 34.87593 -118.6025 1117.5090        3
## 369 2017 185      TejonRanch   5 34.87589 -118.6025 1117.4340        3
## 371 2017 186      TejonRanch   6 34.87584 -118.6025 1117.3410        3
## 373 2017 187      TejonRanch   7 34.87583 -118.6024 1117.2010        3
## 375 2017 188      TejonRanch   8 34.87582 -118.6024 1116.5110        3
## 377 2017 189      TejonRanch   9 34.87574 -118.6023 1115.8020        3
## 379 2017 190      TejonRanch  10 34.87552 -118.6022 1114.5140        3
## 381 2017 191      TejonRanch  11 34.87600 -118.6027 1116.3710        3
## 383 2017 192      TejonRanch  12 34.87607 -118.6027 1116.9490        3
## 385 2017 193      TejonRanch  13 34.87604 -118.6028 1117.4340        3
## 387 2017 194      TejonRanch  14 34.87608 -118.6028 1117.6300        3
## 389 2017 195      TejonRanch  15 34.87612 -118.6026 1117.1640        3
## 391 2017 196      TejonRanch  16 34.87618 -118.6027 1117.7140        3
## 393 2017 197      TejonRanch  17 34.87619 -118.6026 1117.7420        3
## 395 2017 198      TejonRanch  18 34.87619 -118.6026 1118.2090        3
## 397 2017 199      TejonRanch  19 34.87620 -118.6026 1118.0880        3
## 399 2017 200      TejonRanch  20 34.87606 -118.6026 1117.5560        3
## 401 2017 201      TejonRanch  21 34.87646 -118.6018 1117.7609        3
## 403 2017 202      TejonRanch  22 34.87641 -118.6017 1116.6505        3
## 405 2017 203      TejonRanch  23 34.87638 -118.6018 1117.1451        3
## 407 2017 204      TejonRanch  24 34.87639 -118.6018 1117.3970        3
## 409 2017 205      TejonRanch  25 34.87640 -118.6018 1117.1824        3
## 411 2017 206      TejonRanch  26 34.87633 -118.6019 1115.8668        3
## 413 2017 207      TejonRanch  27 34.87628 -118.6019 1116.7532        3
## 415 2017 208      TejonRanch  28 34.87625 -118.6020 1116.4640        3
## 417 2017 209      TejonRanch  29 34.87627 -118.6020 1116.5480        3
## 419 2017 210      TejonRanch  30 34.87623 -118.6020 1117.2290        3
## 421 2016   1    PanocheHills   1 36.70001 -120.8011  656.3209        1
## 423 2016   2    PanocheHills   2 36.70005 -120.8012  656.1902        1
## 425 2016   3    PanocheHills   3 36.70010 -120.8015  656.6475        1
## 427 2016   4    PanocheHills   4 36.70012 -120.8014  657.3752        1
## 429 2016   5    PanocheHills   5 36.70019 -120.8016  656.5075        1
## 431 2016   6    PanocheHills   6 36.70026 -120.8014  655.5837        1
## 433 2016   7    PanocheHills   7 36.70037 -120.8014  655.4344        1
## 435 2016   8    PanocheHills   8 36.70045 -120.8015  655.3132        1
## 437 2016   9    PanocheHills   9 36.70052 -120.8015  655.0519        1
## 439 2016  10    PanocheHills  10 36.70044 -120.8016  655.5371        1
## 441 2016  11    PanocheHills  11 36.70057 -120.8017  656.4329        1
## 443 2016  12    PanocheHills  12 36.70063 -120.8019  657.0300        1
## 445 2016  13    PanocheHills  13 36.70060 -120.8020  657.1606        1
## 447 2016  14    PanocheHills  14 36.70064 -120.8017  656.7687        1
## 449 2016  15    PanocheHills  15 36.70064 -120.8022  657.2166        1
## 451 2016  16    PanocheHills  16 36.70074 -120.8022  656.9554        1
## 453 2016  17    PanocheHills  17 36.70086 -120.8022  656.0223        1
## 455 2016  18    PanocheHills  18 36.70080 -120.8023  656.5541        1
## 457 2016  19    PanocheHills  19 36.70073 -120.8024  656.1996        1
## 459 2016  20    PanocheHills  20 36.70069 -120.8023  655.4438        1
## 461 2016  21    PanocheHills  21 36.70053 -120.8023  655.8543        1
## 463 2016  22    PanocheHills  22 36.70048 -120.8021  657.1420        1
## 465 2016  23    PanocheHills  23 36.70042 -120.8021  657.7485        1
## 467 2016  24    PanocheHills  24 36.70036 -120.8020  658.2523        1
## 469 2016  25    PanocheHills  25 36.70035 -120.8019  658.7189        1
## 471 2016  26    PanocheHills  26 36.70026 -120.8020  658.9055        1
## 473 2016  27    PanocheHills  27 36.70013 -120.8020  658.9988        1
## 475 2016  28    PanocheHills  28 36.70015 -120.8020  659.0361        1
## 477 2016  29    PanocheHills  29 36.70009 -120.8019  658.9614        1
## 479 2016  30    PanocheHills  30 36.70005 -120.8019  659.1201        1
## 481 2016  31          Cuyama   1 34.85522 -119.4885  806.8343        2
## 483 2016  32          Cuyama   2 34.85518 -119.4886  806.5264        2
## 485 2016  33          Cuyama   3 34.85512 -119.4886  806.4984        2
## 487 2016  34          Cuyama   4 34.85506 -119.4885  806.6196        2
## 489 2016  35          Cuyama   5 34.85505 -119.4884  807.0115        2
## 491 2016  36          Cuyama   6 34.85500 -119.4884  806.0505        2
## 493 2016  37          Cuyama   7 34.85489 -119.4885  808.0753        2
## 495 2016  38          Cuyama   8 34.85488 -119.4884  808.7097        2
## 497 2016  39          Cuyama   9 34.85489 -119.4883  808.5231        2
## 499 2016  40          Cuyama  10 34.85476 -119.4884  809.9227        2
## 501 2016  41          Cuyama  11 34.85462 -119.4885  809.3256        2
## 503 2016  42          Cuyama  12 34.85465 -119.4884  809.5961        2
## 505 2016  43          Cuyama  13 34.85454 -119.4884  810.1840        2
## 507 2016  44          Cuyama  14 34.85442 -119.4884  809.8107        2
## 509 2016  45          Cuyama  15 34.85441 -119.4882  810.0720        2
## 511 2016  46          Cuyama  16 34.85436 -119.4881  810.3986        2
## 513 2016  47          Cuyama  17 34.85443 -119.4880  810.0161        2
## 515 2016  48          Cuyama  18 34.85449 -119.4880  811.1917        2
## 517 2016  49          Cuyama  19 34.85461 -119.4879  811.6675        2
## 519 2016  50          Cuyama  20 34.85472 -119.4878  809.8854        2
## 521 2016  51          Cuyama  21 34.85472 -119.4877  810.4172        2
## 523 2016  52          Cuyama  22 34.85484 -119.4876  811.3410        2
## 525 2016  53          Cuyama  23 34.85492 -119.4874  810.9584        2
## 527 2016  54          Cuyama  24 34.85496 -119.4873  811.6302        2
## 529 2016  55          Cuyama  25 34.85500 -119.4874  811.9008        2
## 531 2016  56          Cuyama  26 34.85510 -119.4875  812.1807        2
## 533 2016  57          Cuyama  27 34.85511 -119.4876  812.1248        2
## 535 2016  58          Cuyama  28 34.85508 -119.4876  812.6193        2
## 537 2016  59          Cuyama  29 34.85499 -119.4879  811.4623        2
## 539 2016  60          Cuyama  30 34.85502 -119.4881  811.7795        2
## 541 2016  61         Barstow   1 35.09405 -116.8349  496.0200        4
## 543 2016  62         Barstow   2 35.09391 -116.8348  496.1690        4
## 545 2016  63         Barstow   3 35.09381 -116.8349  495.4130        4
## 547 2016  64         Barstow   4 35.09373 -116.8350  495.4600        4
## 549 2016  65         Barstow   5 35.09372 -116.8350  494.9840        4
## 551 2016  66         Barstow   6 35.09361 -116.8350  494.7600        4
## 553 2016  67         Barstow   7 35.09359 -116.8351  495.0870        4
## 555 2016  68         Barstow   8 35.09358 -116.8351  495.1050        4
## 557 2016  69         Barstow   9 35.09353 -116.8351  495.1520        4
## 559 2016  70         Barstow  10 35.09342 -116.8350  494.9280        4
## 561 2016  71         Barstow  11 35.09338 -116.8352  494.8630        4
## 563 2016  72         Barstow  12 35.09336 -116.8351  494.9000        4
## 565 2016  73         Barstow  13 35.09332 -116.8351  494.8910        4
## 567 2016  74         Barstow  14 35.09325 -116.8352  494.5830        4
## 569 2016  75         Barstow  15 35.09318 -116.8352  495.0680        4
## 571 2016  76         Barstow  16 35.09313 -116.8352  494.8810        4
## 573 2016  77         Barstow  17 35.09310 -116.8353  494.6010        4
## 575 2016  78         Barstow  18 35.09299 -116.8352  494.1160        4
## 577 2016  79         Barstow  19 35.09289 -116.8352  493.9670        4
## 579 2016  80         Barstow  20 35.09276 -116.8352  493.7340        4
## 581 2016  81         Barstow  21 35.09275 -116.8351  573.0444        4
## 583 2016  82         Barstow  22 35.09271 -116.8350  572.1393        4
## 585 2016  83         Barstow  23 35.09280 -116.8349  572.9885        4
## 587 2016  84         Barstow  24 35.09275 -116.8348  572.3166        4
## 589 2016  85         Barstow  25 35.09280 -116.8347  571.7568        4
## 591 2016  86         Barstow  26 35.09287 -116.8348  571.9061        4
## 593 2016  87         Barstow  27 35.09290 -116.8346  571.6915        4
## 595 2016  88         Barstow  28 35.09295 -116.8345  571.9341        4
## 597 2016  89         Barstow  29 35.09302 -116.8347  571.4862        4
## 599 2016  90         Barstow  30 35.09311 -116.8347  571.7195        4
## 601 2016  91   HeartofMojave   1 34.69820 -115.6842  784.7300        5
## 603 2016  92   HeartofMojave   2 34.69811 -115.6841  784.6460        5
## 605 2016  93   HeartofMojave   3 34.69805 -115.6841  784.8510        5
## 607 2016  94   HeartofMojave   4 34.69798 -115.6841  784.8330        5
## 609 2016  95   HeartofMojave   5 34.69792 -115.6841  784.5530        5
## 611 2016  96   HeartofMojave   6 34.69794 -115.6843  784.2630        5
## 613 2016  97   HeartofMojave   7 34.69789 -115.6843  784.3660        5
## 615 2016  98   HeartofMojave   8 34.69784 -115.6844  784.2350        5
## 617 2016  99   HeartofMojave   9 34.69782 -115.6843  783.9930        5
## 619 2016 100   HeartofMojave  10 34.69779 -115.6844  783.2460        5
## 621 2016 101   HeartofMojave  11 34.69776 -115.6843  783.0600        5
## 623 2016 102   HeartofMojave  12 34.69772 -115.6844  783.0410        5
## 625 2016 103   HeartofMojave  13 34.69762 -115.6844  783.1720        5
## 627 2016 104   HeartofMojave  14 34.69764 -115.6845  782.6680        5
## 629 2016 105   HeartofMojave  15 34.69756 -115.6844  782.5840        5
## 631 2016 106   HeartofMojave  16 34.69747 -115.6843  781.8750        5
## 633 2016 107   HeartofMojave  17 34.69735 -115.6843  783.0130        5
## 635 2016 108   HeartofMojave  18 34.69730 -115.6843  782.3690        5
## 637 2016 109   HeartofMojave  19 34.69718 -115.6843  781.3430        5
## 639 2016 110   HeartofMojave  20 34.69714 -115.6843  781.0820        5
## 641 2016 111   HeartofMojave  21 34.69721 -115.6842  770.7805        5
## 643 2016 112   HeartofMojave  22 34.69729 -115.6841  770.9671        5
## 645 2016 113   HeartofMojave  23 34.69745 -115.6838  773.9343        5
## 647 2016 114   HeartofMojave  24 34.69748 -115.6838  773.0945        5
## 649 2016 115   HeartofMojave  25 34.69748 -115.6837  773.9996        5
## 651 2016 116   HeartofMojave  26 34.69755 -115.6837  774.5034        5
## 653 2016 117   HeartofMojave  27 34.69761 -115.6836  774.8766        5
## 655 2016 118   HeartofMojave  28 34.69764 -115.6836  775.0259        5
## 657 2016 119   HeartofMojave  29 34.69769 -115.6837  774.9606        5
## 659 2016 120   HeartofMojave  30 34.69772 -115.6837  775.0726        5
## 661 2016 121 SheepholeValley   1 34.20568 -115.7197  545.9200        6
## 663 2016 122 SheepholeValley   2 34.20574 -115.7195  546.5730        6
## 665 2016 123 SheepholeValley   3 34.20565 -115.7194  546.6290        6
## 667 2016 124 SheepholeValley   4 34.20559 -115.7192  546.2470        6
## 669 2016 125 SheepholeValley   5 34.20563 -115.7192  546.5170        6
## 671 2016 126 SheepholeValley   6 34.20558 -115.7190  546.2930        6
## 673 2016 127 SheepholeValley   7 34.20561 -115.7190  545.8920        6
## 675 2016 128 SheepholeValley   8 34.20555 -115.7190  545.7430        6
## 677 2016 129 SheepholeValley   9 34.20572 -115.7188  546.5080        6
## 679 2016 130 SheepholeValley  10 34.20577 -115.7187  546.9090        6
## 681 2016 131 SheepholeValley  11 34.20580 -115.7186  547.1330        6
## 683 2016 132 SheepholeValley  12 34.20594 -115.7186  547.8890        6
## 685 2016 133 SheepholeValley  13 34.20611 -115.7187  548.4580        6
## 687 2016 134 SheepholeValley  14 34.20626 -115.7190  549.5310        6
## 689 2016 135 SheepholeValley  15 34.20632 -115.7192  550.0070        6
## 691 2016 136 SheepholeValley  16 34.20631 -115.7194  550.3800        6
## 693 2016 137 SheepholeValley  17 34.20628 -115.7196  549.9420        6
## 695 2016 138 SheepholeValley  18 34.20625 -115.7196  550.1560        6
## 697 2016 139 SheepholeValley  19 34.20627 -115.7197  549.4560        6
## 699 2016 140 SheepholeValley  20 34.20618 -115.7198  549.1950        6
## 701 2016 141 SheepholeValley  21 34.20650 -115.7194  598.3586        6
## 703 2016 142 SheepholeValley  22 34.20652 -115.7192  597.8641        6
## 705 2016 143 SheepholeValley  23 34.20664 -115.7191  599.4130        6
## 707 2016 144 SheepholeValley  24 34.20678 -115.7192  600.1594        6
## 709 2016 145 SheepholeValley  25 34.20664 -115.7192  597.9014        6
## 711 2016 146 SheepholeValley  26 34.20659 -115.7193  597.4069        6
## 713 2016 147 SheepholeValley  27 34.20659 -115.7195  595.8207        6
## 715 2016 148 SheepholeValley  28 34.20658 -115.7198  595.4101        6
## 717 2016 149 SheepholeValley  29 34.20655 -115.7199  595.5687        6
## 719 2016 150 SheepholeValley  30 34.20661 -115.7199  596.3432        6
## 721 2016 151          Tecopa   1 35.85152 -116.1867  699.4567        7
## 723 2016 152          Tecopa   2 35.85145 -116.1867  699.5779        7
## 725 2016 153          Tecopa   3 35.85141 -116.1867  700.2591        7
## 727 2016 154          Tecopa   4 35.85134 -116.1866  700.8936        7
## 729 2016 155          Tecopa   5 35.85130 -116.1866  700.1472        7
## 731 2016 156          Tecopa   6 35.85127 -116.1866  699.6806        7
## 733 2016 157          Tecopa   7 35.85121 -116.1866  700.7536        7
## 735 2016 158          Tecopa   8 35.85118 -116.1865  700.9216        7
## 737 2016 159          Tecopa   9 35.85117 -116.1864  702.2092        7
## 739 2016 160          Tecopa  10 35.85127 -116.1863  702.9650        7
## 741 2016 161          Tecopa  11 35.85123 -116.1862  702.8064        7
## 743 2016 162          Tecopa  12 35.85118 -116.1863  704.1033        7
## 745 2016 163          Tecopa  13 35.85115 -116.1864  704.3740        7
## 747 2016 164          Tecopa  14 35.85108 -116.1865  705.4656        7
## 749 2016 165          Tecopa  15 35.85108 -116.1866  705.0178        7
## 751 2016 166          Tecopa  16 35.85102 -116.1866  706.5200        7
## 753 2016 167          Tecopa  17 35.85116 -116.1867  706.6413        7
## 755 2016 168          Tecopa  18 35.85123 -116.1867  707.5930        7
## 757 2016 169          Tecopa  19 35.85124 -116.1868  707.6583        7
## 759 2016 170          Tecopa  20 35.85130 -116.1869  445.7271        7
## 761 2016 171          Tecopa  21 35.85133 -116.1868  446.2497        7
## 763 2016 172          Tecopa  22 35.85140 -116.1869  447.1734        7
## 765 2016 173          Tecopa  23 35.85145 -116.1869  447.4533        7
## 767 2016 174          Tecopa  24 35.85146 -116.1868  448.7690        7
## 769 2016 175          Tecopa  25 35.85150 -116.1868  448.7130        7
## 771 2016 176          Tecopa  26 35.85152 -116.1869  449.0116        7
## 773 2016 177          Tecopa  27 35.85147 -116.1869  447.8639        7
## 775 2016 178          Tecopa  28 35.85153 -116.1870  449.0209        7
## 777 2016 179          Tecopa  29 35.85168 -116.1870  448.9182        7
## 779 2016 180          Tecopa  30 35.85101 -116.1872  449.0209        7
## 781 2016 181      TejonRanch   1 34.87599 -118.6025 1118.0220        3
## 783 2016 182      TejonRanch   2 34.87595 -118.6025 1118.0500        3
## 785 2016 183      TejonRanch   3 34.87593 -118.6025 1117.6300        3
## 787 2016 184      TejonRanch   4 34.87593 -118.6025 1117.5090        3
## 789 2016 185      TejonRanch   5 34.87589 -118.6025 1117.4340        3
## 791 2016 186      TejonRanch   6 34.87584 -118.6025 1117.3410        3
## 793 2016 187      TejonRanch   7 34.87583 -118.6024 1117.2010        3
## 795 2016 188      TejonRanch   8 34.87582 -118.6024 1116.5110        3
## 797 2016 189      TejonRanch   9 34.87574 -118.6023 1115.8020        3
## 799 2016 190      TejonRanch  10 34.87552 -118.6022 1114.5140        3
## 801 2016 191      TejonRanch  11 34.87600 -118.6027 1116.3710        3
## 803 2016 192      TejonRanch  12 34.87607 -118.6027 1116.9490        3
## 805 2016 193      TejonRanch  13 34.87604 -118.6028 1117.4340        3
## 807 2016 194      TejonRanch  14 34.87608 -118.6028 1117.6300        3
## 809 2016 195      TejonRanch  15 34.87612 -118.6026 1117.1640        3
## 811 2016 196      TejonRanch  16 34.87618 -118.6027 1117.7140        3
## 813 2016 197      TejonRanch  17 34.87619 -118.6026 1117.7420        3
## 815 2016 198      TejonRanch  18 34.87619 -118.6026 1118.2090        3
## 817 2016 199      TejonRanch  19 34.87620 -118.6026 1118.0880        3
## 819 2016 200      TejonRanch  20 34.87606 -118.6026 1117.5560        3
## 821 2016 201      TejonRanch  21 34.87646 -118.6018 1117.7609        3
## 823 2016 202      TejonRanch  22 34.87641 -118.6017 1116.6505        3
## 825 2016 203      TejonRanch  23 34.87638 -118.6018 1117.1451        3
## 827 2016 204      TejonRanch  24 34.87639 -118.6018 1117.3970        3
## 829 2016 205      TejonRanch  25 34.87640 -118.6018 1117.1824        3
## 831 2016 206      TejonRanch  26 34.87633 -118.6019 1115.8668        3
## 833 2016 207      TejonRanch  27 34.87628 -118.6019 1116.7532        3
## 835 2016 208      TejonRanch  28 34.87625 -118.6020 1116.4640        3
## 837 2016 209      TejonRanch  29 34.87627 -118.6020 1116.5480        3
## 839 2016 210      TejonRanch  30 34.87623 -118.6020 1117.2290        3
##        Abundance    Richness       Biomass
## 1    0.116161616 -0.50000000  0.7119778644
## 3    0.087818697 -0.60000000  0.4796531205
## 5    0.080906149 -0.33333333  0.6615644834
## 7   -0.121568627 -0.50000000  0.2712539822
## 9    0.049853372 -0.50000000  0.4593215503
## 11   0.184357542 -0.50000000  0.6795536250
## 13   0.261780105 -0.50000000  0.4608192877
## 15  -0.252427184  0.00000000  0.4919018585
## 17  -0.174887892 -0.33333333  0.6526389444
## 19   0.014423077 -0.50000000  0.5086644867
## 21   0.139534884 -0.33333333  0.3631851602
## 23   0.210653753 -0.50000000  0.5080463308
## 25  -0.780104712  0.00000000  0.4349842452
## 27   0.311827957 -0.50000000  0.7702038806
## 29   0.336708861 -0.60000000  0.2323219991
## 31   0.392670157 -0.50000000  0.3712568032
## 33   0.110526316 -0.33333333  0.2790786494
## 35   0.290322581 -0.33333333  0.8636516386
## 37   0.111111111 -0.33333333  0.6788779257
## 39   0.144508671 -0.33333333  0.7595415671
## 41   0.412300683 -0.50000000  0.8449457768
## 43   0.419354839 -0.50000000 -0.1049540415
## 45   0.357798165 -0.50000000  0.6227795285
## 47   0.219858156 -0.33333333 -0.0902199449
## 49   0.330000000 -0.33333333  0.6187907821
## 51   0.126760563 -0.33333333  0.7574940805
## 53   0.248908297 -0.50000000  0.5044125134
## 55   0.040767386 -0.50000000  0.5665006524
## 57   0.323456790  0.00000000  0.7189177620
## 59   0.307462687  0.00000000  0.4426137567
## 61   0.475504323 -0.66666667  0.6770310149
## 63   0.223529412 -0.33333333  0.8100986434
## 65   0.444743935 -0.20000000  0.6336056940
## 67  -0.023529412 -0.50000000  0.7814083673
## 69   0.191637631 -0.60000000 -0.0870758305
## 71  -0.360655738 -0.20000000  0.1184504218
## 73   0.238434164  0.00000000  0.8905726334
## 75   0.341772152 -0.60000000  0.9400286944
## 77  -0.789473684 -0.50000000  0.7695158398
## 79   0.235955056 -0.20000000  0.5964276417
## 81   0.318750000 -0.50000000  0.4039094315
## 83  -0.035087719 -0.20000000  0.4961624763
## 85  -0.100671141 -0.20000000  0.4602290313
## 87  -0.107142857 -0.20000000  0.4550573406
## 89   0.077844311 -0.50000000  0.5893232187
## 91   0.275362319 -0.20000000  0.7070642723
## 93  -0.166666667  0.00000000  0.4056391915
## 95   0.575757576 -0.20000000  0.8496008659
## 97  -0.105882353  0.00000000  0.4560603999
## 99  -0.185185185 -0.60000000  0.3895348185
## 101  0.166666667 -0.33333333  0.6450904620
## 103  0.012448133 -0.60000000  0.5448609160
## 105  0.026548673 -0.50000000  0.5547202132
## 107 -0.362637363 -0.33333333  0.2152793275
## 109 -0.083969466 -0.33333333  0.4733767791
## 111 -0.041420118 -0.50000000  0.5058660462
## 113 -0.178294574 -0.50000000  0.3955781995
## 115 -0.465648855  0.00000000  0.0938392832
## 117  0.292134831 -0.60000000  0.7160642623
## 119  0.300000000 -0.20000000  0.7202401148
## 121 -0.069767442  0.00000000  0.8483307317
## 123  0.670886076  0.50000000  0.8016949153
## 125 -0.258064516  0.50000000  0.8142623553
## 127  0.400000000 -0.20000000  0.7902743020
## 129 -0.312500000  0.50000000  0.4274566970
## 131 -0.052631579 -0.33333333  0.5074892105
## 133 -0.368421053  0.00000000  0.4073927026
## 135 -0.037037037  0.33333333  0.6696825136
## 137  0.222222222  0.20000000  0.4387597894
## 139 -0.179487179  0.00000000  0.2695463320
## 141  0.312500000  0.00000000  0.4541074440
## 143 -0.028571429 -0.50000000  0.1521536453
## 145 -0.777777778  0.00000000  0.5596072931
## 147  0.076923077  0.00000000  0.8679251279
## 149 -0.272727273 -0.20000000  0.7130066743
## 151 -0.150000000  0.00000000  0.5380087283
## 153 -0.125000000 -0.50000000  0.9397717963
## 155 -0.034482759  0.33333333  0.4481977343
## 157 -0.153846154  0.20000000  0.3940984309
## 159 -0.161290323  0.14285714  0.6146335434
## 161 -0.021276596 -0.33333333  0.2152743275
## 163  0.333333333  0.00000000  0.7832666333
## 165 -0.034482759  0.00000000  0.6498431394
## 167  0.142857143  0.20000000  0.8402163451
## 169 -0.476190476 -0.14285714  0.3567608862
## 171 -0.076923077  0.33333333  0.6519212141
## 173 -0.111111111  0.00000000  0.2074660006
## 175  0.000000000  0.50000000  0.8967097043
## 177  0.111111111  0.33333333  0.9217960271
## 179 -0.448275862 -0.50000000 -0.5522570506
## 181  0.411764706 -0.33333333  0.8533612299
## 183  1.000000000  1.00000000  1.0000000000
## 185  0.333333333  0.20000000  0.5700227101
## 187  0.222222222  0.00000000  0.1455301455
## 189  0.310344828 -0.25000000  0.2102272727
## 191  0.714285714  0.60000000  0.6671493587
## 193  0.172413793 -0.20000000  0.0506990062
## 195  0.391304348 -0.14285714  0.7011118378
## 197 -0.111111111 -0.14285714  0.2945083620
## 199  0.000000000  0.20000000  0.9061425061
## 201 -0.083333333  0.00000000  0.3469970429
## 203  0.285714286  0.00000000  0.7982496545
## 205  0.000000000  0.14285714 -0.1149301826
## 207  1.000000000  1.00000000  1.0000000000
## 209  0.304347826  0.00000000  0.7495439299
## 211  0.294117647  0.20000000  0.7542619910
## 213  0.272727273  0.33333333  0.8833221251
## 215  0.176470588  0.60000000  0.8143354903
## 217  0.214285714 -0.14285714  0.8192456119
## 219 -0.142857143  0.14285714  0.3285299495
## 221  0.354838710  0.50000000 -0.2584942085
## 223  0.081081081  0.00000000  0.0354693197
## 225  0.058823529 -0.33333333  0.5296251511
## 227  1.000000000  1.00000000  1.0000000000
## 229  0.083333333 -0.20000000  0.8066840601
## 231  1.000000000  1.00000000  1.0000000000
## 233  1.000000000  1.00000000  1.0000000000
## 235  1.000000000  1.00000000  1.0000000000
## 237  0.250000000  0.33333333  0.6100965831
## 239  1.000000000  1.00000000  1.0000000000
## 241  0.461538462  0.20000000  0.4317400039
## 243  0.120000000  0.00000000 -0.0587628553
## 245 -0.360000000  0.00000000  0.6923697110
## 247  0.750000000  0.42857143  0.6393058945
## 249  0.777777778  0.60000000  0.7798188223
## 251 -0.120000000  0.00000000  0.4696642911
## 253  1.000000000  1.00000000  1.0000000000
## 255 -0.272727273 -0.20000000  1.0000000000
## 257  1.000000000  1.00000000  0.9201925608
## 259 -0.333333333  0.50000000  0.5734497079
## 261  0.000000000  0.00000000  1.0000000000
## 263  1.000000000  1.00000000  1.0000000000
## 265  0.391304348  0.11111111  0.7209858818
## 267  0.285714286 -0.14285714 -0.3734034560
## 269  0.166666667  0.14285714  0.7327057183
## 271  0.120000000  0.14285714  0.3756266122
## 273  0.000000000  0.00000000  0.0000000000
## 275  1.000000000  1.00000000  1.0000000000
## 277  0.818181818  0.33333333  0.4608250720
## 279  0.466666667 -0.14285714  0.6183624064
## 281  0.428571429  0.00000000  0.7515356072
## 283  0.176470588 -0.20000000  0.8261728100
## 285  0.428571429  0.20000000  0.9261516655
## 287  0.428571429  0.14285714  0.9148376772
## 289  0.333333333  0.00000000  0.1529029029
## 291  0.272727273  0.33333333  0.4494782901
## 293  0.555555556  0.20000000  0.3213861292
## 295  0.833333333  0.50000000  0.7620473727
## 297  0.529411765  0.33333333  0.7677135242
## 299 -0.466666667 -0.20000000 -0.0003025352
## 301  0.541666667  0.00000000  0.8890477983
## 303  0.285714286  0.33333333  0.5099159664
## 305  1.000000000  1.00000000 -0.3159687437
## 307  0.478260870  0.00000000 -0.0193116226
## 309  0.548387097 -0.33333333 -0.7561455261
## 311  0.488372093  0.33333333  0.6375491617
## 313 -0.170731707 -0.33333333  0.7590221187
## 315  0.297297297 -0.33333333  0.8505929820
## 317  0.085714286  0.00000000  0.5696080789
## 319  0.265306122  0.00000000  0.9412910878
## 321  0.416666667  0.00000000  0.6330641418
## 323  0.351351351  0.00000000  0.9117237890
## 325  0.032258065 -0.33333333  0.6542429594
## 327 -0.176470588 -0.33333333  0.9460873064
## 329 -0.333333333  0.20000000  0.4748446582
## 331  0.176470588  0.00000000  0.2407950472
## 333  0.428571429  0.00000000  0.7813517136
## 335  0.106382979  0.20000000  0.6535572249
## 337  0.219512195  0.00000000  0.0622276029
## 339  0.106382979  0.20000000  0.8631557122
## 341  0.243243243  0.20000000  0.6847489888
## 343  0.733333333  0.00000000  0.8604977217
## 345  0.657142857 -0.50000000  0.9009414654
## 347  0.428571429  0.20000000  0.1832829809
## 349  0.428571429 -0.20000000  0.8294730575
## 351  0.750000000  0.00000000  0.9396562233
## 353 -0.310344828  0.20000000  0.5641348440
## 355  0.166666667 -0.20000000  0.8345676199
## 357  0.288888889 -0.20000000 -0.5533338128
## 359  0.345454545  0.20000000  0.7327935223
## 361  0.343750000  0.20000000  0.1179597085
## 363  0.085714286  0.00000000  0.6375540134
## 365  0.565217391  0.00000000  0.1778108927
## 367 -0.223529412  0.00000000 -0.7049122704
## 369  0.302325581 -0.14285714  0.7018751576
## 371  0.262135922 -0.20000000  0.5240219453
## 373  0.426470588 -0.20000000  0.9176670543
## 375  0.421052632  0.14285714  0.9266820402
## 377  0.194444444 -0.11111111  0.6235886798
## 379  0.353535354 -0.33333333  0.9160009368
## 381  0.223529412 -0.25000000  0.4068392907
## 383  0.111111111 -0.20000000  0.9252881544
## 385  0.290322581  0.00000000  0.4647619048
## 387  0.102564103  0.00000000  0.1074135091
## 389  0.596153846  0.00000000  0.6919047329
## 391  0.438596491 -0.14285714  0.5588887903
## 393  0.095238095  0.25000000  0.9118715622
## 395  0.127272727 -0.14285714  0.4872740419
## 397 -0.214285714 -0.25000000  0.5206069618
## 399  0.093525180  0.20000000  0.7185471220
## 401  0.360000000  0.00000000  0.5236393303
## 403 -0.207547170 -0.33333333 -0.0060926826
## 405  0.145454545  0.00000000  0.3372343362
## 407  0.418604651  0.00000000  0.5719982574
## 409  0.405405405  0.00000000  0.5611774811
## 411 -0.009708738 -0.33333333  0.1923509561
## 413  0.428571429 -0.11111111  0.5800751438
## 415 -0.183098592 -0.20000000  0.0192870201
## 417  0.220000000 -0.11111111  0.4037345143
## 419  0.115789474  0.00000000  0.3102095924
## 421  0.119791667 -0.20000000  0.7760647974
## 423 -0.075528701 -0.33333333  0.6450734218
## 425  0.194968553  0.00000000  0.6753403391
## 427  0.283950617 -0.50000000  0.3187107425
## 429 -0.060606061  0.00000000  0.5602055411
## 431  0.209638554 -0.33333333  0.7245922230
## 433 -0.088305489 -0.20000000  0.5199622692
## 435 -0.108695652 -0.20000000  0.5324523087
## 437 -0.155963303 -0.20000000  0.6342772166
## 439  0.023411371 -0.20000000  0.5831058879
## 441 -0.067615658  0.00000000  0.4780803053
## 443  0.228668942 -0.33333333  0.5786466279
## 445  0.225563910 -0.20000000  0.4091330441
## 447  0.434944238  0.00000000  0.7276661111
## 449  0.192878338 -0.20000000  0.2933046724
## 451  0.269841270 -0.33333333  0.4066365964
## 453 -0.085501859 -0.33333333  0.2083004494
## 455  0.112676056 -0.50000000  0.8278076115
## 457  0.135802469  0.00000000  0.7399925355
## 459  0.067669173 -0.33333333  0.7541348051
## 461  0.013477089  0.00000000  0.8467352912
## 463 -0.087281796 -0.20000000 -0.1555443792
## 465  0.203252033  0.00000000  0.6507663648
## 467  0.147982063  0.00000000 -0.0252802706
## 469  0.092783505  0.00000000  0.6221160673
## 471  0.231481481  0.00000000  0.7005202920
## 473 -0.141630901 -0.33333333  0.5133369497
## 475 -0.044247788  0.00000000  0.6413994801
## 477  0.065292096  0.00000000  0.6690707102
## 479  0.042904290 -0.33333333  0.4821652581
## 481 -0.469387755 -0.42857143 -0.7142306828
## 483 -0.146341463  0.14285714 -0.5397365232
## 485 -0.046153846 -0.14285714  0.2602530238
## 487 -0.586206897 -0.33333333 -0.3460967506
## 489 -0.709090909 -0.20000000 -0.6203491478
## 491 -0.617977528 -0.14285714 -0.3028959760
## 493 -0.421052632 -0.42857143 -0.0844666818
## 495 -0.575757576 -0.33333333  0.5792090246
## 497  0.061224490  0.00000000  0.2045544817
## 499 -0.322033898 -0.60000000 -0.5770450569
## 501 -0.566265060 -0.50000000 -0.4144435004
## 503 -0.473684211 -0.20000000  0.2508168305
## 505 -0.523809524  0.00000000 -0.0665371781
## 507 -0.173913043  0.00000000 -0.3258603613
## 509 -0.484848485 -0.42857143 -0.0507908134
## 511 -0.243902439 -0.60000000  0.4355660064
## 513 -0.555555556 -0.14285714  0.1735652429
## 515 -0.569620253 -0.14285714 -0.2625670758
## 517 -0.291666667 -0.14285714  0.0291344504
## 519 -0.777777778 -0.33333333 -0.8276938655
## 521 -0.435294118 -0.25000000 -0.3816837175
## 523 -0.263157895 -0.14285714 -0.2207533760
## 525 -1.000000000 -1.00000000 -0.0044416878
## 527 -0.672727273 -0.50000000 -0.4692221884
## 529 -0.525423729 -0.33333333 -0.6178713022
## 531 -0.707865169 -0.25000000 -0.1590170966
## 533 -0.391304348 -0.20000000 -0.1611568092
## 535  0.461538462  0.25000000  0.3753283347
## 537 -0.521739130 -0.20000000  0.5213391895
## 539 -0.395348837 -0.66666667  0.5102448342
## 541  0.000000000  0.00000000  0.0000000000
## 543  0.000000000  0.00000000  0.0000000000
## 545  0.000000000  0.00000000  0.0000000000
## 547  0.000000000  0.00000000  0.0000000000
## 549  0.000000000  0.00000000  0.0000000000
## 551  0.000000000  0.00000000  0.0000000000
## 553  0.000000000  0.00000000  0.0000000000
## 555  0.000000000  0.00000000  0.0000000000
## 557  0.000000000  0.00000000  0.0000000000
## 559  0.000000000  0.00000000  0.0000000000
## 561  0.000000000  0.00000000  0.0000000000
## 563  0.000000000  0.00000000  0.0000000000
## 565  0.000000000  0.00000000  0.0000000000
## 567  0.000000000  0.00000000  0.0000000000
## 569  0.000000000  0.00000000  0.0000000000
## 571  0.000000000  0.00000000  0.0000000000
## 573  0.000000000  0.00000000  0.0000000000
## 575  0.000000000  0.00000000  0.0000000000
## 577  0.000000000  0.00000000  0.0000000000
## 579  0.000000000  0.00000000  0.0000000000
## 581  0.000000000  0.00000000  0.0000000000
## 583  0.000000000  0.00000000  0.0000000000
## 585  0.000000000  0.00000000  0.0000000000
## 587  0.000000000  0.00000000  0.0000000000
## 589  0.000000000  0.00000000  0.0000000000
## 591  0.000000000  0.00000000  0.0000000000
## 593  0.000000000  0.00000000  0.0000000000
## 595  0.000000000  0.00000000  0.0000000000
## 597  0.000000000  0.00000000  0.0000000000
## 599  0.000000000  0.00000000  0.0000000000
## 601  0.090909091  0.00000000  0.0653773778
## 603 -0.714285714 -0.50000000 -0.6126435068
## 605  0.000000000  0.00000000 -0.5626066874
## 607  0.636363636  0.33333333  0.0541506322
## 609  0.444444444  0.00000000  0.3603976342
## 611  0.428571429  0.20000000  0.1440466750
## 613  0.100000000  0.11111111 -0.1163394391
## 615  0.666666667  0.60000000  0.3524324736
## 617 -0.166666667 -0.25000000  0.3681481097
## 619 -0.333333333 -0.25000000 -0.6793068477
## 621 -0.090909091  0.25000000 -0.5180089771
## 623  0.368421053  0.00000000  0.1999727712
## 625 -0.500000000  0.00000000 -0.3983889528
## 627  0.416666667  0.00000000  0.2348139481
## 629 -0.500000000  0.00000000  0.1677600750
## 631 -0.222222222 -0.09090909  0.2765970257
## 633 -0.066666667 -0.11111111 -0.2515765549
## 635  0.750000000  0.71428571 -0.2304842213
## 637  0.076923077  0.20000000  0.4736807388
## 639  0.217391304  0.00000000  0.3278188942
## 641  0.500000000  0.33333333  0.5121937686
## 643  0.428571429  0.00000000  0.5644350976
## 645  0.818181818  0.33333333  0.7509420420
## 647  0.000000000  0.20000000  0.0419393939
## 649  0.600000000  0.50000000 -0.2105005707
## 651  1.000000000  1.00000000  1.0000000000
## 653  0.090909091 -0.14285714  0.5270261941
## 655  1.000000000  1.00000000  1.0000000000
## 657  1.000000000  1.00000000  1.0000000000
## 659  1.000000000  1.00000000  0.5756888942
## 661  0.000000000  0.00000000  0.0000000000
## 663 -1.000000000 -1.00000000 -1.0000000000
## 665 -1.000000000 -1.00000000 -1.0000000000
## 667 -0.500000000  0.00000000 -0.1854517901
## 669  0.000000000  0.00000000  0.0000000000
## 671 -0.333333333 -0.33333333 -1.0000000000
## 673  1.000000000  1.00000000  1.0000000000
## 675 -0.500000000 -0.50000000 -1.0000000000
## 677 -0.523809524  0.33333333 -0.0067197783
## 679 -1.000000000 -1.00000000 -1.0000000000
## 681  1.000000000  1.00000000  1.0000000000
## 683 -1.000000000 -1.00000000 -1.0000000000
## 685  0.000000000  0.00000000  0.1361361361
## 687  1.000000000  1.00000000  1.0000000000
## 689  0.000000000  0.00000000  0.0000000000
## 691  0.333333333  0.33333333  0.0359679267
## 693  1.000000000  1.00000000  1.0000000000
## 695  0.000000000  0.00000000  1.0000000000
## 697 -0.200000000  0.00000000  0.2269216624
## 699 -1.000000000 -1.00000000 -1.0000000000
## 701  0.000000000  0.00000000 -1.0000000000
## 703  0.000000000  0.00000000  0.0000000000
## 705  0.000000000  0.00000000  0.0000000000
## 707 -1.000000000 -1.00000000 -1.0000000000
## 709  0.000000000  0.00000000  0.0000000000
## 711  0.000000000  0.00000000  0.0000000000
## 713 -1.000000000 -1.00000000 -1.0000000000
## 715  1.000000000  1.00000000  1.0000000000
## 717  0.000000000  0.00000000  0.0000000000
## 719  0.000000000  0.00000000  0.0000000000
## 721  0.377358491  0.00000000  0.3484005285
## 723  0.505154639 -0.20000000 -0.0318575779
## 725  0.312500000  0.00000000  0.6159210920
## 727  0.441860465  0.20000000  0.5693343899
## 729 -0.122807018  0.00000000  0.0441698012
## 731  0.473684211 -0.20000000  0.4318516005
## 733  0.489361702  0.33333333 -0.5605433282
## 735 -0.045454545  0.00000000  0.8379392199
## 737  0.000000000  0.00000000  0.5036670159
## 739 -0.186440678 -0.33333333  0.4705570292
## 741  0.224489796  0.00000000  0.4530265803
## 743  0.261538462  0.00000000  0.4337169160
## 745 -0.044776119  0.20000000  0.4990751910
## 747 -0.219512195 -0.33333333  0.5602957031
## 749  0.310344828  0.00000000  0.9537213059
## 751 -0.137254902 -0.50000000  0.2299884660
## 753  0.018867925  0.00000000  0.4872008036
## 755  0.244444444 -0.33333333  0.5423092289
## 757 -0.125000000 -0.60000000  0.2539237668
## 759  0.346938776 -0.66666667 -0.1012083626
## 761  0.289473684  0.00000000  0.1958249759
## 763  0.257142857 -0.20000000  0.0970992480
## 765  0.192982456 -0.33333333  0.7428781261
## 767 -0.236363636  0.00000000  0.8792069086
## 769 -0.128205128 -0.20000000  0.1232449298
## 771  0.407407407  0.00000000  0.6149531455
## 773  0.132075472 -0.60000000  0.7241809842
## 775  0.317073171 -0.20000000  0.2104357140
## 777 -0.120000000  0.20000000 -0.1236287160
## 779 -0.160000000  0.33333333  0.4350836408
## 781  0.382716049  0.20000000 -0.0125921551
## 783  0.303030303  0.00000000 -0.0013919268
## 785 -0.062500000  0.33333333  0.1931782458
## 787 -0.333333333  0.14285714 -0.8667356779
## 789  0.138461538  0.25000000  0.4275430035
## 791  0.000000000  0.33333333  0.6825802976
## 793  0.163636364  0.14285714  0.5992973553
## 795 -0.222222222 -0.20000000 -0.0999432785
## 797  0.000000000 -0.11111111 -0.6727514596
## 799  0.161290323 -0.11111111  0.6025874346
## 801  0.196581197 -0.14285714 -0.4921950789
## 803  0.015384615  0.14285714 -0.0394353574
## 805 -0.475409836  0.20000000 -0.4762100212
## 807  0.170731707  0.25000000 -0.3190357440
## 809  0.052631579  0.00000000  0.7788296402
## 811  0.093525180 -0.09090909 -0.5659009699
## 813  0.156626506  0.25000000 -0.2578781513
## 815  0.160493827 -0.14285714  0.0833863781
## 817 -0.217391304 -0.42857143  0.5182010956
## 819  0.373134328  0.33333333  0.2026123137
## 821  0.250000000 -0.42857143 -0.1397175313
## 823 -0.345454545 -0.20000000  0.3225661732
## 825 -0.153846154 -0.14285714 -0.5790226460
## 827  0.243902439  0.33333333 -0.1462200957
## 829 -0.075000000 -0.50000000  0.5087807832
## 831 -0.254901961  0.11111111  0.3546859422
## 833  0.225806452  0.00000000  0.6949414737
## 835  0.026315789  0.33333333  0.0135630499
## 837  0.111111111  0.14285714 -0.0244374546
## 839 -0.016949153  0.00000000  0.2277740481
rii.mean <- rii.dat %>% group_by(Year, Gradient, Site) %>% summarize(avg=mean(Biomass),se=se(Biomass))
rii.mean <- data.frame(rii.mean)

plot(rii.mean[rii.mean$Year==2016,"Gradient"]-.1,rii.mean[rii.mean$Year==2016,"avg"], ylim=c(-1,1), pch=19, cex=1.5, xlim=c(0.5,7.5), ylab="Rii Biomass", xlab="Site", xaxt="n", cex.lab=1.5)
axis(1, 1:7, lab=unique(rii.mean$Site))
error.bar(rii.mean[rii.mean$Year==2016,"Gradient"]-.1,rii.mean[rii.mean$Year==2016,"avg"],rii.mean[rii.mean$Year==2016,"se"])
error.bar(rii.mean[rii.mean$Year==2017,"Gradient"]+.1,rii.mean[rii.mean$Year==2017,"avg"],rii.mean[rii.mean$Year==2017,"se"])
points(rii.mean[rii.mean$Year==2017,"Gradient"]+.1,rii.mean[rii.mean$Year==2017,"avg"], pch=21, bg="Grey50", cex=1.5)
abline(h=0, lwd=2, lty=2)
legend(6.6,-0.65, c("2016","2017"), pch=22, pt.bg=c("Black","Grey50"), cex=1.6)

## add year column to precipitation data
precip[,"Year"] <- ifelse(precip$season=="season.1","2016","2017")
rii.precip <- merge(precip,rii.mean, by=c("Year","Gradient"))



ihs <- function(x) {
    y <- log(x + sqrt(x ^ 2 + 1))
    return(y)
}

## Precipitation vs Rii
plot(log(rii.precip[,"Precip"]), rii.precip[,"avg"], ylab= "RII", xlab="log precipitation Precipitation", pch=19, cex=1.5, cex.lab=1.5, cex.axis=1.3)
abline(h=0, lwd=2, lty=2)

m1 <- lm(rii.precip[,"avg"] ~ rii.precip[,"Precip"])